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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
holywasabi
Frequent Visitor

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
    holywasabi_1-1720161320638.png

     

I've created a supporting table - Age Group [as shown in the image below], with a min and max value.

 

holywasabi_0-1720160962886.png

 

I am getting errors for my DAX code  : 

 

Customer Age (Sort : Sign-up date) =
IF(
    [Customer Age (Based on year signed-up)] <= MAX(  'Age Group'[Max]  )
    &&
    [Customer Age (Based on year signed-up)] >= MAX(  'Age Group'[Min]  ),
    VALUES( 'Age Group'[Age Group] ),
    BLANK()
)

Appreciate any pointers, thanks! 😊
1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super 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]
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
holywasabi
Frequent Visitor

This works, thank you very much! 😊

bhanu_gautam
Super User
Super 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]
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.