Forum Discussion
Age bracket : Conditional Formatting not working
Hi all, a helpless newbie here.
I want to create a measure (not calculated column) that :
- categorises a customer according to their age when they sign up
- This is what I hope to achieve
I've created a supporting table - Age Group [as shown in the image below], with a min and max value.
I am getting errors for my DAX code :
Appreciate any pointers, thanks! 😊
holywasabi , Try using below dax
Customer Age Group =
VAR CustomerAge = [Customer Age (Based on year signed-up)]
RETURN
CALCULATE(
VALUES('Age Group'[Age Group]),
FILTER(
'Age Group',
CustomerAge >= 'Age Group'[Min] &&
CustomerAge <= 'Age Group'[Max]
)
)
2 Replies
- bhanu_gautamSuper User
holywasabi , Try using below dax
Customer Age Group =
VAR CustomerAge = [Customer Age (Based on year signed-up)]
RETURN
CALCULATE(
VALUES('Age Group'[Age Group]),
FILTER(
'Age Group',
CustomerAge >= 'Age Group'[Min] &&
CustomerAge <= 'Age Group'[Max]
)
) - holywasabiFrequent Visitor
This works, thank you very much! 😊