Locked lesson.
About this lesson
What is Q&A? Great question! Check out this module not only to get an Answer, but to learn how to tailor those answers as well.
Exercise files
Download this lesson’s related exercise files. You can download the source data files for the course from the resources section of your Lessons page.
Working with Q&A.pbix348.3 KB Working with Q&A - Completed.pbix
348.9 KB
Quick reference
Working with Q&A
Using Q&A to ask the database for information.
When to use
When you want to query the data set using English. (Or when you forgot to include a visual, you can tell your boss to just “ask the system”.).
Instructions
To use Q&A:
- Open a dashboard in PowerBI.com
- Click inside the box that says “Ask a question about your data”
- Type your question
Adding “English” or “Industry” terms to your data
- Go to Power BI Desktop
- Select Relationship view (on the left)
- Select your table
- Go to Modeling --> Synonyms
- Enter alternative terms for your data fields
- Save your project
- Re-publish to PowerBI.com
Hints & tips
- Known terms show up below the Q&A question area
- Visuals generated by Q&A can be pinned to a dashboard by clicking the pin icon
Login to download
- 00:04 What I wanna show you now is something really cool, it's called Q&A.
- 00:08 And what this is,
- 00:09 it's a natural language query interface to ask the system questions about your data.
- 00:15 I've signed into the Power BI service again, and the reason being is because
- 00:19 Q&A only works online, it does not work in Power BI Desktop.
- 00:24 When I sign in, it takes me immediately to my Recent items, you'll notice here.
- 00:29 And you can see that the two items I've been playing around with were
- 00:32 the Loaded Pencil report with this icon, and the Loaded Pencil dashboard.
- 00:36 Now, if I want my dashboard to come up first and
- 00:38 foremost, I can click little star and it'll now actually put it in Favorites.
- 00:43 And now when I sign in it'll give me this as a priority item,
- 00:46 to say hey look this is one of your favorite dashboards.
- 00:48 So for right now I'm gonna click on it because Q&A works from a dashboard, and
- 00:53 where it actually works is it's right at the top here where it says,
- 00:57 Ask a Question about your data.
- 00:59 So I could go and click on this and you'll notice at this point it comes up and
- 01:02 it's got some fields down here for the loaded pencil.
- 01:05 But the nice little part about here is that I could go and
- 01:09 say show me sales by location.
- 01:12 And you'll notice that as I type that in, it actually goes in and
- 01:16 starts prompting me with some different pieces, that I can actually see and
- 01:21 build charts out of, which is kinda cool.
- 01:23 So I can say, well that's kinda neat but,
- 01:25 maybe I want something that I haven't built yet, how about sales by hour?
- 01:30 Now, you'll notice at this point that my stuff is not really sorted all that well
- 01:34 12, 11, 13, 20, 21, that's not good.
- 01:37 So let's try with sorted by hour.
- 01:42 And now we can actually go and see that it has sorted it by hour and
- 01:45 it would appear that for this fictional restaurant chain,
- 01:49 that the busy hours are between the 11 o'clock and, 1 o'clock hour.
- 01:53 So this obviously does a pretty heavy lunch train here, and
- 01:57 then remains pretty steady for the rest of the day.
- 02:00 So this is really kinda cool, this is a neat little feature, and
- 02:03 it works on dashboards that you share with other people.
- 02:06 I had a client once who told me he says yeah, he says I love this,
- 02:08 this was awesome because, he says I sent out a dashboard to my boss and
- 02:12 my boss phones me up and he says.
- 02:13 Ben he goes you didn't give me the report that I always need, so
- 02:16 he responded with well why don't you just ask the system cuz it'll give it to you.
- 02:20 Now, you gotta be a little careful because that can be a bit of a career shortening
- 02:24 move the way you see it, but the cool thing was is that he didn't have to
- 02:27 wait for my client to go and develop the report.
- 02:29 The boss could just go and type it in in natural language and boom,
- 02:32 the question came up.
- 02:33 So, now, instead of asking you all those crazy questions,
- 02:36 they can start asking the system.
- 02:38 And if they find something that they really like,
- 02:41 well check this out Pen Visual.
- 02:43 Pen which dashboard, I'm gonna put it on my loaded pencil dashboard.
- 02:46 So now, when I go back to my dashboard,
- 02:48 you'll see that not only do I have my total sales cards and whatnot,
- 02:52 I've also have my account of sales by hours, so that's pretty cool.
- 02:56 And I think buried somewhere over here there was my latest state, so
- 02:59 I'm gonna move that into screen where I can see it a little bit easier.
- 03:02 So this is kinda cool cuz now as you see you can start asking questions about your
- 03:06 data and getting more information.
- 03:08 But, there's a challenge with part of it, do I expect my users to go and
- 03:13 ask the system and say hey, give me sales by location.
- 03:16 Or would they be more likely to say, I'd like to see sales by pub?
- 03:20 Well the problem is is that inside my data set, pub doesn't exist anywhere.
- 03:25 So what I'm gonna do is, I'm gonna flip back to Power BI Desktop, so
- 03:28 this is the original report that we're actually working with.
- 03:32 And what I'm gonna do now, is I'm gonna go and say,
- 03:35 all right, let's go back to the Relationship View.
- 03:39 And inside Relationship View, we have this little table that's showing here,
- 03:43 so this is all the field names.
- 03:45 Data shows us all the data, the visual canvas shows us that, but
- 03:49 Relationships is a special window.
- 03:51 Because when you come here, and you select your table and
- 03:54 go to Modeling, you get the option to provide synonyms for your data.
- 03:58 So I can select Synonyms and it says, all right, this is your sales table so
- 04:02 we have a location name.
- 04:03 Well I could come over to location name and I could say, let's call this pub or
- 04:07 comma restaurant.
- 04:11 I could go in and put it in something different for street,
- 04:14 city, I mean province.
- 04:15 There's another one that might be really useful for that might be state, we could
- 04:20 try spelling latitude out a little longer, and longitude, we could do the same thing.
- 04:25 We could go over here and call it longitude.
- 04:30 And if you have spelling errors that are really common in your organization,
- 04:34 you could actually fix things up like that as well.
- 04:36 So, all of these things here add extra ways that we can query Q&A,
- 04:41 how do you actually make them work?
- 04:43 Well, your gonna go back and your going to save your file, so
- 04:48 you can click on the Save icon and then once again, you can publish it.
- 04:54 Now at this point its going to say hey, would you like to replace your data set?
- 04:58 And that's okay, we're gonna say Y, let's replace it this will update it.
- 05:02 So, if we've updated any data by hitting the big refresh button here it would
- 05:05 stream it through all the steps that we've done,
- 05:08 then we can publish this back to Power BI.
- 05:10 And now we can say, let's go back and open it up in Power BI again, so
- 05:14 it'll reload the page for me that's nice.
- 05:17 And nothing looks any different here whatsoever,
- 05:19 what about that visual we made through Q&A that we pinned, is it gone?
- 05:23 Well let's go take a look, My Workspace,
- 05:25 let's go back to our loaded pencil dashboard.
- 05:28 Nope it's still there, that's cool, so now let's go back and try this out,
- 05:32 we'll ask a question about our data.
- 05:34 Let's go and say sales by pub, and look at that,
- 05:38 we can actually have it worked quite nicely.
- 05:41 And it will show us what what we're looking for here, sales by pub, by hour.
- 05:45 Can we actually get something?
- 05:46 I admit it's kinda an ugly chart, but it makes chart, which is the kinda cool
- 05:50 thing we've added a new term this industry specific to our data.
- 05:55 Or we can also use it to take out industry specific terms and
- 05:58 put them back into pure English.
- 06:00 Now, Q&A works in English, it's also in Preview and Spanish at the moment, and
- 06:04 I anticipate that they'll add more languages as time goes on.
Lesson notes are only available for subscribers.