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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors