Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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"))
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |