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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ptmuldoon
Resolver I
Resolver I

Creating a Measures Slicer; Formatting Issue

Note, I am currently working with Excel, Power Query, and Power Pivot, and will move this is to Power BI model in the near future.

 

I am attempting to create a slicer where the user can then change the measure easily, and found this how here, and got it work ok

hXXps://sqljason.com/2012/11/measure-selection-using-slicers-in.html

 

But the issue I'm facing is that when I format a particular measure, the values in the pivot table switch to text and you can not highlight them and get a total, etc.

 

This is the basic measure:

MsrValue:=switch (TRUE,
Min ( MyMeasures[ID] ) = 1, [Amount],
Min ( MyMeasures[ID] ) = 2, Format([Last 3 Amount], "Currency"),
Min ( MyMeasures[ID] ) = 3, [YTD Amount]
)

And when using that in a pivot table, the measure formatted as currency appears as text in the pivot table, while the other 2 will show as a number value. You can see that here below as the Last 3 Amount formatted in Currency is left justified in the values.

 

ptmuldoon_0-1702345411283.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ptmuldoon , Option 1
Use field parameters with individual formatted measures 

 

Option 2

Use Dynamic format String
https://powerbi.microsoft.com/en-us/blog/deep-dive-into-the-new-dynamic-format-strings-for-measures/

 

https://youtu.be/qHALucET7N8

Or Use calculation groups

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @ptmuldoon,

Current you can't use one measure expression to return multiple result data types. (notice: format function will change the result of text type)

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@ptmuldoon , Option 1
Use field parameters with individual formatted measures 

 

Option 2

Use Dynamic format String
https://powerbi.microsoft.com/en-us/blog/deep-dive-into-the-new-dynamic-format-strings-for-measures/

 

https://youtu.be/qHALucET7N8

Or Use calculation groups

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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