There have been some updates to Power BI with Visual Calculations, and as of the March 2024 release you can now create and edit visual calculations in the Power BI Service.

Here are details from the blog post: Power BI March 2024 Feature Summary | Visual Calculations Update

I then saw an email which made me think, could I then use the visual calculations to create a DAX measure directly in the Power BI Service on an existing Power BI report.

The answer to my own question is YES YOU CAN!

And in this blog post I will show you how I did it.

In my example below I want to create a % of Grand Total.

I went to my report in the Power BI Service and viewed the report, I then clicked on Edit.

Next, I went to my table visual, clicked on the three dots and selected “New calculation”.

A screenshot of a computer screen

Description automatically generated

As always, I like to do it in individual steps to make sure I each step is having the desired result.

The first visual calculation I needed to create is to get the total value across all rows. And I do think of this as using a slightly different version of DAX to get the results.

To do this I created the following visual calculation, I used this visual calculation which gave me the total across all the rows.

Overall Total = FORMAT(COLLAPSEALL([Sales], ROWS),"$#,##")

Once I applied this, I could then see that I was getting the total across all the rows as shown below, I also formatted the value to make it easier for readability. The highlighted box is showing the total from the entire table, which allowed me to confirm that my visual calculation was correct.

Now the final visual calculation is easier because I could just reference the visual calculations in my table. To do this I created the visual calculation below.

Percent of Grand Total = FORMAT(DIVIDE([Sales],[Overall Total]),"Percent")

As shown below I now got the Percent of Grand Total

A screenshot of a computer

Description automatically generated

The final step is I could now hide the visual calculation called “Overall Total”, by going into the columns and clicking on the “Hide from Visual”

A screenshot of a computer

Description automatically generated

Now when I look at my table, I can see the desired results.

A screenshot of a graph

Description automatically generated

Finally, I saved my report, which could then be viewed by others, or if I was using an App, I would then update the app to reflect the changes.

Summary

In this blog post I have shown you how I created a DAX measure in a report directly in the Power BI Service.

I am sure that this should open some new experiences.

Any comments or suggestions are most welcome, thanks for reading!