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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
NickDSL
Helper I
Helper I

If any combination of three column happens return a value

Hi I have the following DAX code for a column:

Risk Assessment =
IF(SP_ResidentDemos[PercentileAge]="90th" && SP_ResidentDemos[PercentileLOS]="90th" && SP_ResidentDemos[PercentileScore]="90th","High",
IF(SP_ResidentDemos[PercentileAge]="90th" && SP_ResidentDemos[PercentileLOS]="75th" && SP_ResidentDemos[PercentileScore]="90th","Medium-High",
IF(SP_ResidentDemos[PercentileAge]="75th" && SP_ResidentDemos[PercentileLOS]="75th" && SP_ResidentDemos[PercentileScore]="75th","Medium",
IF(SP_ResidentDemos[PercentileAge]="50th" && SP_ResidentDemos[PercentileLOS]="50th" && SP_ResidentDemos[PercentileScore]="50th","Low",
BLANK())))

The line I want to focus on at the moment is:
IF(SP_ResidentDemos[PercentileAge]="90th" && SP_ResidentDemos[PercentileLOS]="75th" && SP_ResidentDemos[PercentileScore]="90th","Medium-High",


Is there a way to have my DAX be formatted to return "Medium-High" if any of the three referenced columns contains any combination of 90th, 90th, 75th? In my DAX line I have "SP_ResidentDemos[PercentileLOS]" equal to 75th but should "SP_ResidentDemos[PercentileAge]" equal 75th I would like it to also return Medium-High without having to write another IF statement for this if possible. If it is required I write a bunch of IF statements I will do it.

In later stages this will also contain Medium-Low and perhaps several other permutations of High, Medium, and Low.
1 ACCEPTED SOLUTION
NickDSL
Helper I
Helper I

Found my own solution. 

Pseudocode:

IF 50th THEN 1. If 75th THEN 2. IF 90th THEN 3. Make these columns for all three percentile columns.

Make a column summing all values from the three columns.

Apply range of Low-High on numbers 3-9, with 3 being Low and 9 being High.

View solution in original post

3 REPLIES 3
NickDSL
Helper I
Helper I

Found my own solution. 

Pseudocode:

IF 50th THEN 1. If 75th THEN 2. IF 90th THEN 3. Make these columns for all three percentile columns.

Make a column summing all values from the three columns.

Apply range of Low-High on numbers 3-9, with 3 being Low and 9 being High.

Ashish_Mathur
Super User
Super User

Hi,

I think this is possible.  Share the download link of the PBI file and clearly show the table where you want to get the result.  Also, share a 4 column table.  In the first 3 columns show all possible combinations of 90, 75 and 50.  In the fourth column, show the category (text) which describes that combination i.e. High, Medium high etc.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Read about SWITCH()

 

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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