Skip to main content

Power BI

Needs Votes

DAX Query Language Visual

Vote (1460) Share
Matt Allington's profile image

Matt Allington on 04 Nov 2017 04:26:24

I see big value in creating a visual that can display the results of a DAX query. One way this could be deployed is a follows.
* Add the new visual to the report canvas
* Write a DAX query that returns a table (of course) and add this to the visual
* The visual would respect any cross filtering coming from the report just like any other visual.

This would give report writers very granular control to display records without having to use a table visual and a measure that triggers the display of the correct records.

Administrator on 30 Jul 2020 16:56:46

At the moment we don't have any plans to implement this. It sounds like it's mostly useful for learning/training? If there are other 'production' scenarios that you think it'd be useful, where a regular table/matrix wouldn't work, please let us know in the comments!

Comments (23)
Matt Allington's profile image Profile Picture

07be6b9b 29ec-4707-b2b4-2e33276e5bc3 on 05 Jul 2020 23:41:57

RE: DAX Query Language Visual

This isn’t learning training. This is development. It is very diff in a complex measure that isn’t working to figure out what is going on. This would allow us to see to tables a function returns without having to fire up DAX Studio on the side.

Matt Allington's profile image Profile Picture

64d831e1 d3eb-4fba-b6b5-495a49298d5f on 05 Jul 2020 23:40:51

RE: DAX Query Language Visual

'@Will Thompson: This isn't a training/learning feature at all. This is an advanced feature for people who know DAX well and want to be able to make reports more sophisticated than what is possible by dragging/dropping fields and measures.

Matt Allington's profile image Profile Picture

64d831e1 d3eb-4fba-b6b5-495a49298d5f on 05 Jul 2020 23:32:11

RE: DAX Query Language Visual

This would absolutely transform how useful Power BI is. At the moment, visuals use a very abstracted view of the data model, which is then translated into DAX by the Power BI engine. This approach is good for allowing drag/drop fields and so on, but causes excessive friction when attempting to make a query that doesn't quite fit the abstracted model. For example, when including special logic for filtering rows based on BLANK () values.

Matt Allington's profile image Profile Picture

51a2caa1 f5a9-4bbb-b127-fd51ab6d6096 on 05 Jul 2020 23:25:10

RE: DAX Query Language Visual

One of the best ideas. That will be the best teacher of DAX and Power Bi.

Matt Allington's profile image Profile Picture

a3309361 99be-ea11-a812-000d3a8ddfb2 on 05 Jul 2020 23:12:23

RE: DAX Query Language Visual

Great Idea It would help for people like me how are weak in DAX

Matt Allington's profile image Profile Picture

3ebb0af5 0f33-4622-87f0-5ef7baf7d858 on 05 Jul 2020 23:09:26

RE: DAX Query Language Visual

I'm hoping a DAX Context display "visual" comes out soon as I suggested here: https://www.sqlbi.com/articles/context-transition-and-filters-in-calculate/?utm_source=wysija&utm_medium=email&utm_content=more&utm_campaign=1-2018

Matt Allington's profile image Profile Picture

aa58bc26 10cb-4b82-9d47-ab50e4854f70 on 05 Jul 2020 23:08:23

RE: DAX Query Language Visual

'@Paul, Its different because its affected by slicers in your report context. For example if you have a sales table with some dimensions like client, date, product and two numeric fileds: units and revenue. You could easily write a query to see the total units and avg price by price range, and then play with different slicers so the table will show you the distribuition of your sales for the current selection. Furthermore you could define the number of buckets for the price range in another slicer and play with detail level too.

Finally if you implement this via a dynamic data layer as I sugest you could use any visual on top of your query and for example create a dynamic histogram.

All this is trivial to do in Tableau and really really complicated/impossible in PBI. In my opinion distribuition visualization is the greatest weakness of this tool. Sanddance was a step in the right direction but its development seams to be stopped, so I really hope they eventually implement this idea.

Matt Allington's profile image Profile Picture

1afb5152 6d67-40fd-8ef9-451a25719d09 on 05 Jul 2020 23:07:32

RE: DAX Query Language Visual

I get the idea but how is this different from adding another table to the model, with or without relationships to other tables?

Matt Allington's profile image Profile Picture

aa58bc26 10cb-4b82-9d47-ab50e4854f70 on 05 Jul 2020 23:05:51

RE: DAX Query Language Visual

It would be even better if we could use those dynamic queries in any visual. Like dynamic data layer with tables affected by current context filters. This way we could have dynamically calculated columns and a simpler way to calculate some complex measures.

Matt Allington's profile image Profile Picture

e9bb9b42 78d9-4487-b88f-82baaca4bdcd on 05 Jul 2020 23:04:27

RE: DAX Query Language Visual

i dont quite understand what you mean....