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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.