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
AmudhaKumaran
Helper I
Helper I

DAX - Assign a category based on other column

Hi Team,

I'm trying to solve a simple DAX, but struck somewhere. I have a table like sample shared below. IDs are scored on different categories and their grade is marked by Category Zone (If Category Score between 3 & 5 then Green else if Category Score between 2 & 2.9 then Yellow else if Category Score between 1 & 1.9 then Red else if Category Score = 0 then Automatic Red else NA). And Current Overall Zone is based on Total Score with the same logic as in Category Zone.

Now, I want to change the Overall Zone for an ID to Red regardless of Total, if any of the Category Zone is Automatic Red.

Any suggestion would really help.

AmudhaKumaran_0-1634105356232.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AmudhaKumaran , a new column

 


var _1 = countx(filter(Table, [ID] = earlier([ID]) && [Category Score] =0), [Category Score])
return
if(isblank(_1), [Current Overall Zone], "Red")

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@AmudhaKumaran , a new column

 


var _1 = countx(filter(Table, [ID] = earlier([ID]) && [Category Score] =0), [Category Score])
return
if(isblank(_1), [Current Overall Zone], "Red")

Hi @amitchandak ,

Thanks for your quick response. My issue is resolved now. 

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.