Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Dear friends,
i want to get gap from average score from all year data, but the data can't read because my slicer require single selection of year.
Score 2021 = 5.00
Score 2020 = 3.50
the gap score i want to show is 1.50, but if year select is 2021, 2020 data will not be calculated.
here is the pbix file : https://drive.google.com/file/d/10Gpy0UJmCDTovC8NJ25OtS5divb-QDmq/view?usp=sharing
Thanks for help
Solved! Go to Solution.
Hi @ade_kurniawan ,
You need make a little bit change to your Gap score Measure.
Gap score =
VAR selectedYear =
MAX ( Sheet1[Year] )
VAR CurrentScore =
CALCULATE (
[avg score],
FILTER ( ALL ( Sheet1 ), Sheet1[Year] = selectedYear )
)
VAR LastScore =
CALCULATE (
[avg score],
FILTER ( ALL ( Sheet1 ), Sheet1[Year] = MAX ( Sheet1[Year] ) - 1 )
)
RETURN
CurrentScore - LastScore
Then, the result should look like this.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Hi @ade_kurniawan ,
You need make a little bit change to your Gap score Measure.
Gap score =
VAR selectedYear =
MAX ( Sheet1[Year] )
VAR CurrentScore =
CALCULATE (
[avg score],
FILTER ( ALL ( Sheet1 ), Sheet1[Year] = selectedYear )
)
VAR LastScore =
CALCULATE (
[avg score],
FILTER ( ALL ( Sheet1 ), Sheet1[Year] = MAX ( Sheet1[Year] ) - 1 )
)
RETURN
CurrentScore - LastScore
Then, the result should look like this.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
thank you so much
@ade_kurniawan , in such cases, it is best to have the date/year come from a separatetable. joined to your table
Last year avg =
Calculate([Avg Score], filter(All(Date[Year]), Date[Year] = max(Date[Year])-1))
diff =
[Avg Score] - [Last year avg]
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
18 | |
15 | |
12 | |
11 | |
8 |
User | Count |
---|---|
24 | |
17 | |
11 | |
11 | |
10 |