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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ChuckChuck2
New Member

Create a virtual "status" as a measure that is not aggregated

Hello. I need use a measue to assign a text value that will be displayed in a table visual. e.g., 

Status =
VAR _Status =
if( [Value 1st] > [Value 2nd], "Up", IF( [Value 1st] < [Value 2nd], "Down", "Flat"))
RETURN
_Status

 

This works as expected on the table on the left, but when I remove the customer, the table is aggregating by unique color "Black", but this is not what I want. I want to see Black continue to be listed for each "Status" (Up and Down). Please note, I cannot make the "Status" a calculated column because it will need to be dynamic based on slicer selections in the final version. 

2022-12-12_18-16-13.png

1 ACCEPTED SOLUTION
ChuckChuck2
New Member

I've figured out a solution. I've created a stand alone table with the possible status values and a generic key of "1". I then added a column to my fact table with a generic key of "1". In the model, I then join the table of possible status values to my fact table (with a bridge table between to avoid the many-to-many relationship). 


I then use a switch statement to test if the value is Up, Down, etc. and map the resulting value to the status table value using the Switch function.2022-12-13_8-20-27.png

View solution in original post

1 REPLY 1
ChuckChuck2
New Member

I've figured out a solution. I've created a stand alone table with the possible status values and a generic key of "1". I then added a column to my fact table with a generic key of "1". In the model, I then join the table of possible status values to my fact table (with a bridge table between to avoid the many-to-many relationship). 


I then use a switch statement to test if the value is Up, Down, etc. and map the resulting value to the status table value using the Switch function.2022-12-13_8-20-27.png

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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