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
Anonymous
Not applicable

DAX conditional on multiple text columns

Hi,

 

I am looking to create a measure that is conditional on two attributes. 

 

Unfortunately I am not able to come up with the DAX expression that allows me to reference Customer[Group] or Sales[Category].

 

It relates to two different data tables below.

 

Customer table:

GroupNameRate
AJohn50%
BFred50%
CAlex100%

 

Sales table:

NameCategoryAmount
JohnFood100
JohnBeverage200
FredFood50
FredBeverage50
FredEquipment100
AlexFood200
AlexBeverage50
AlexEquipment100

 

I was thinking I would need to use SUMX, but also thought it would work like below;

 

New Rate = IF(Customer[Group]="B" && Sales[Category]="Equipment", 100% , else Customer[Rate])

 

New Amount= sum(Sales[Amount]) * [New Rate]

 

End result should be;

NameCategoryNew Amount
JohnFood50
JohnBeverage100
FredFood25
FredBeverage25
FredEquipment100
AlexFood200
AlexBeverage50
AlexEqiupment100

 

and it needs to work on an aggregate basis too;

 

NameNew Measure
John150
Fred150
Alex350

 

Thanks in advance!

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Try like

New Rate = IF(maxx(filter(Customer, Customer[name] =sales[name]),Customer[Group])="B" && Sales[Category]="Equipment", 100% , else Customer[Rate])

 

or

 

New Rate = IF(related(Customer[Group])="B" && Sales[Category]="Equipment", 100% , else Customer[Rate])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks @amitchandak ,

 

The first option almost works, but I cannot reference sales[name] for the filter part, as it is in a different table I believe.

 

Unfortunately the second option is exactly what I had in mind, but I cannot reference either Group or Category.  It only lets me reference measures.

@Anonymous , first one should work as new column in sales, Are you trying as measure.

 

refer my video - https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.