Skip to main content

Power BI

Needs Votes

DAX calculations at visual level of reports

Vote (2124) Share
Marco Russo's profile image

Marco Russo on 22 May 2020 15:48:20

Provide a simple way to write formulas that work with the data displayed in a visual. For example, the running total of a measure in a table or in a chart according to the sort order of the visual should be something like this:

Running Total = ReportData[Sales] + PREVIOUS ( ReportData[Running Total] )

Where ReportData is the content of the current visual, Sales and Running Total are the names of the columns in the current visual. The user is not expected to know the model content, the calculation can be executed on top of any data currently being displayed.

More details about a proposal for visual calculations in DAX here:
https://www.sqlbi.com/articles/a-proposal-for-visual-calculations-in-dax/

Comments (56)
Marco Russo's profile image Profile Picture

e4e98bc7 d3d0-ea11-a812-000d3a579c39 on 28 Jul 2020 13:24:03

RE: DAX calculations at visual level of reports

I really like this idea, this will give better separation of the reporting model measures versus the semantic model calculations or measure

Marco Russo's profile image Profile Picture

392b9ea1 682d-4f0b-ba93-b7d48304f873 on 06 Jul 2020 00:17:51

RE: DAX calculations at visual level of reports

Yes, indeed. XLCubed is a good alternative. It allows the creation of calculations at the visual (table) level.

Marco Russo's profile image Profile Picture

5b4607af 57af-4f6a-95fb-9f79f48c79de on 06 Jul 2020 00:17:49

RE: DAX calculations at visual level of reports

As an Accountant/Finance type, I’m finding it difficult to convince others in my field to invest what they would need to in DAX. Calculations at a visual level would bring this group functionality without having to make the full investment in DAX upfront. My hope would be that this would bring better adoption from a broader business group.

Marco Russo's profile image Profile Picture

11874a8b a1e8-4d76-bc1f-4d6caadb7a37 on 06 Jul 2020 00:17:48

RE: DAX calculations at visual level of reports

Or ... use a client like XLCubed which embraces Excel. No need to wait for future enhancements. Available today!

Marco Russo's profile image Profile Picture

6db1f552 470e-4dcf-967f-b6930f640ad6 on 06 Jul 2020 00:17:09

RE: DAX calculations at visual level of reports

Perhaps a more DAXy step in a similar direction would be to add ordered iterators. Think of SQL's LAG operator but inside a DAX iterator function. While adding the concept of ordering is likely non-trivial under the hood, it would definitely help with Running Total, as well as any other path dependent calculations. I've created an idea with another use case and a possible syntax at

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/40647124-ordered-iterators

Marco Russo's profile image Profile Picture

1c5d647f ab7e-424b-8892-bc0e03dcfc43 on 06 Jul 2020 00:17:02

RE: DAX calculations at visual level of reports

When thinking about evaluating competing BI tools MS would do well to note that some very old BI tools have this equivalent functionality; lack of it is creating resistance to PBI adoption at my workplace. DAX is great but not easy as Marco & Alberto would say.

Marco Russo's profile image Profile Picture

f66b7e42 1c77-4dfe-bcc5-c8ff88306631 on 06 Jul 2020 00:16:42

RE: DAX calculations at visual level of reports

Agreed - these "visual functions" would make it easier for new users including advanced Excelers to adopt and see the value of migrating onto a centralised data platform. Otherwise many will simply give up on the DAX mind-twist (context transitioning multi-layer, multi-functions for subtotals!), focus on their work and turn to another tool, avoiding it in future or full roll-out.

Thank you Marco & Alberto for applying your deep understanding to this. Microsoft – you should take up this valuable insight and idea!

Marco Russo's profile image Profile Picture

3d86e903 c023-4395-afa7-ce17419dbb81 on 06 Jul 2020 00:16:23

RE: DAX calculations at visual level of reports

Another thing that can be possible is to reuse some part of data that we already query (i.e. Highlight the Total Sales of a table/matrix in a Card)

Marco Russo's profile image Profile Picture

3d86e903 c023-4395-afa7-ce17419dbb81 on 06 Jul 2020 00:16:22

RE: DAX calculations at visual level of reports

I remember how frustrating was when I discover that EARLIER function isn't equivalent to LAG on SQL. With this proposal this can become reality!

Marco Russo's profile image Profile Picture

7c1f4665 5e07-4952-aa59-8c0a1059baba on 06 Jul 2020 00:16:19

RE: DAX calculations at visual level of reports

Very much like this idea!