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
hbgv123
Frequent Visitor

DAX Measure based on multiple fields

Hi, 

I am trying structure my calculations using DAX and i cannot change my datamodel.

I need to calculate two measures

Rating Measure - this is calculated by considering sum of above/ sum of under from format column when setting is Rating

Target Measure- this is calculated by considering sum of above/ sum of under from format column when setting is Target

I achieved this calculation in powerquery but i wanted to use DAX for other reasons.

Can you help in providing tips to achieve these measures?

 

DateProductFormatSettingValue
Jan-23LuxAboveRating20
Jan-23LuxUnderRating30
Jan-23LuxAboveTarget30
Jan-23LuxUnderTarget40
Feb-23LuxAboveRating30
Feb-23LuxUnderRating40
Feb-23LuxAboveTarget40
Feb-23LuxUnderTarget50
Mar-23LuxAboveRating45
Mar-23LuxUnderRating45
Mar-23LuxAboveTarget40
Mar-23LuxUnderTarget50

 

 

Expected solution for rating and target measure:

hbgv123_0-1693981616455.png

 

 

Thanks for your help

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

Rating Measure=DIVIDE(CALCULATE(SUM(Data[Value]),Data[Format]="Rating",Data[Setting]="Above"),CALCULATE(SUM(Data[Value]),Data[Format]="Rating",Data[Setting]="Under"))

Target Measure=DIVIDE(CALCULATE(SUM(Data[Value]),Data[Format]="Target",Data[Setting]="Above"),CALCULATE(SUM(Data[Value]),Data[Format]="Target",Data[Setting]="Under"))

View solution in original post

1 REPLY 1
wdx223_Daniel
Super User
Super User

Rating Measure=DIVIDE(CALCULATE(SUM(Data[Value]),Data[Format]="Rating",Data[Setting]="Above"),CALCULATE(SUM(Data[Value]),Data[Format]="Rating",Data[Setting]="Under"))

Target Measure=DIVIDE(CALCULATE(SUM(Data[Value]),Data[Format]="Target",Data[Setting]="Above"),CALCULATE(SUM(Data[Value]),Data[Format]="Target",Data[Setting]="Under"))

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.