March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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?
Date | Product | Format | Setting | Value |
Jan-23 | Lux | Above | Rating | 20 |
Jan-23 | Lux | Under | Rating | 30 |
Jan-23 | Lux | Above | Target | 30 |
Jan-23 | Lux | Under | Target | 40 |
Feb-23 | Lux | Above | Rating | 30 |
Feb-23 | Lux | Under | Rating | 40 |
Feb-23 | Lux | Above | Target | 40 |
Feb-23 | Lux | Under | Target | 50 |
Mar-23 | Lux | Above | Rating | 45 |
Mar-23 | Lux | Under | Rating | 45 |
Mar-23 | Lux | Above | Target | 40 |
Mar-23 | Lux | Under | Target | 50 |
Expected solution for rating and target measure:
Thanks for your help
Solved! Go to Solution.
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"))
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"))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
16 | |
12 | |
9 | |
7 |
User | Count |
---|---|
38 | |
32 | |
28 | |
12 | |
11 |