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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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