Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
538 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Using a DAX query to show a table in Power BI |
---|
Did you know that you can write an EVALUATE DAX query in software like DAX Studio and then run it from within Power BI to create a new table? You do now! |
So here's something I didn't know was possible. Whether it's useful is another question! Let's say you've written a DAX query in an application such as DAX Studio:
-- list out a set of rows
EVALUATE
SUMMARIZE(
ADDCOLUMNS(
-- show all the purchases made in London
FILTER(
Purchase,
RELATED(Region[RegionName])="London"
),
-- with an additional column showing the town name
"Town",
RELATED(Town[TownName])
),
-- group by the town name ...
[Town],
-- ... and show total quantity
"Total quantity",
SUM(Purchase[Quantity])
)
When you execute this DAX query, it lists out data from a Power BI data model:
The query shows results like this.
You now want to show this as a table in a Power BI report. To do this, use the New Table button:
You can find this New table button on the Modeling tab of the ribbon.
Paste in your DAX query, excluding the EVALUATE command at the start:
Your query should now return a table of data in Power BI.
This shows the same table of information!
You can now treat this as any other table in Power BI.
I would guess that this technique might be useful for people who know the DAX querying language but aren't as familiar with Query Editor.
Some other pages relevant to the above blog include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.