Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Changing dynamic measures' formatting and keeping it a number

I find it hard to believe this but Power BI is a MS product and I heard this is common...

 

Issue: Formatting a number with a number mask transforms it in a string, which in turns restrics the use of charts and data bars (matrix).

 

Today I found out that when changing the data format of a dynamic measure for simple visualisation purposes and practicity on the business user side, I hinder other functionalities.

 

Scenario: I am building a Planned vs Actual dashboard, where I can analyse $ currency, # amount, % premium, etc. I have 2 measures(Actual & Planned), that change their outcome based on a VAR value that is selected in a filter by the end user. See example below for actual (Planned is exac. same):

 

Actual =
VAR MySelection = SELECTEDVALUE(<Measure>)
RETURN
SWITCH ( TRUE(),
MySelection = "Cost", FORMAT([$ Actual Cost],"$#,##0.0")
.
.
.
)

The downside of that approach is when using format the outcome turns out a string. This causes great grief as I cannot use charts or data bars in a matrix as PBI needs a value/number to do so.

 

I have tried calculated groups, changing the data type in the background, etc and no luck. I simply cannot change the format of a parameter within a measure with multiple measures. My end goal is to have the outcome data, formatted the way I want it and still be able to use it elsewhere as a number

 

I appreciate any suport. But since this problem seems to be open since 2017, I have little hope on getting this resolved.

 

Eddie

 

 

5 REPLIES 5
Anonymous
Not applicable

Is this it, Power BI is this limited? Any expert from the community can provide a practical solution to this?

 

This has been a request since 2017, it is hard to believe there has been no improvement since then...

Anonymous
Not applicable

 

Hi @amitchandak, thanks for your reply. I have tried calculation groups before. I watched all the videos and spent considerable time on it and it does not seem to have the right use for this. Calculation groups seems ideal only for time intelligence?

 

Perhaps you could guide me on how this would work in a simple matrix with Date rows and Planned, Actual columns responsive to a single filter (lets say total cost, total amount) showing, most importantly, dynamically formatted numbers

 

Eddie

 

Hi @Anonymous ,

 

Create different measures in the calculation group and format them.

V-lianl-msft_0-1615529244629.pngV-lianl-msft_1-1615529257018.png

Create another measure slicer.

V-lianl-msft_2-1615529301433.png

Result

V-lianl-msft_3-1615529366747.pngV-lianl-msft_4-1615529374445.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @V-lianl-msft thanks for your input. 

 

This might work for a simple time intelligence manipulation of measures but I am sure it does not work for multiple measures as it is described in the problem with the Actual vs Planned.

 

I am still working through this and so far PBI does not have a simple solution to this simple formatting issue.

 

I will update this topic if I have a breakthrough.

 

Eddie

amitchandak
Super User
Super User

@Anonymous , I think with calculation group using the tabular editor you might be able to do that. Please check these two

 

https://www.youtube.com/watch?v=vlnx7QUVYME

calculation groups
https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.