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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Eric25
New Member

Value Formatting Based Upon Slicer Selected Measure

I'm using a Slicer Table to create a custom report writer where the user selects the variables they wish to see and the matrix responds.

 

I accomplish this using Switch:

 

Value1 = SWITCH(MAX('Value1'[V1Sel]),1,[Rev $],2,[GM%],3,[NM %],4,[Spoil %],5,[Comm %],6,[Machines],7,[Cashless %],8,[Spoil $],9,[Comm $],9,[Subsidy %],10,[Fill %],11,[Depleted %],12,[Sellouts Per Visit])
 
The user selects from a slicer which sets the max of 'Value1'[V1Sel] which switches between various defined measures.
 
My problem is that these values have various formats from percentages to numbers to currency. In regular Excel, I used conditional formatting rules pointing to another table to solve for this. In power BI this isn't possible.
 
I used FORMAT to change the measures to display correctly but because FORMAT changes everything to text, they no longer sort properly.
 
Anyone have any ideas?
1 REPLY 1
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Eric25 ,

 


My problem is that these values have various formats from percentages to numbers to currency. 

In Power BI, measure doesn't support multiple data types in its result. Currently, there is no way to achieve such a requirement, unless using FORMAT function to convert result to Text.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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 MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.