Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Good afternoon,
I am trying to insert a card that calculates the difference between two existing cards. The report that I would like to show makes it possible to show the sales of four different years, which can be handpicked using a slicer. This allows users to compare the years they would like to see.
To make it a bit more concrete, let's say I would like to compare the bike sales of various years (and these years can be handpicked by the user, which is why the report should be responsive in case one selects a different year).
By selecting the year 2015, the cards below will show the amount of bikes sold and the sales revenue. The page basically looks like this:
Year (slicer) - 2015 | Year (slicer) - 2016 | Year (slicer) - 2017 | Year (slicer) - 2018 |
Sales volume 2015: 80 bikes | Sales volume 2016: 90 bikes | Sales volume 2017: 50 bikes | Sales volume 2018: 70 bikes |
Sales revenue 2015: € 16,000 | Sales revenue 2016: € 18,000 | Sales revenue 2017: € 10,000 | Sales revenue 2018: € 14,000 |
I would like to include cards in between these existing cards that calculate the difference between the selected years, meaning the report should look like this:
Year - 2015 | Year - 2016 | Year - 2017 | Year - 2018 | |||
SV: 80 | +10 | SV: 90 | -40 | SV: 50 | +20 | SV: 70 |
SR: 16k | +2k | SR: 18k | -8k | SR: 10k | +4k | SR: 14k |
In the future, I would also like to include multiplications using these numbers, but this is the first step towards that. Is this possible? Can anyone point me in the right direction?
Thanks in advance!
Best regards, Jan
Solved! Go to Solution.
Hi @RFC_JWK ,
You can create a 'What if' parameter and modify the [Measure2].
Measure 2 =
CALCULATE(
SUM(Sheet7[Sales]),
FILTER(
ALLSELECTED(Sheet7),
Sheet7[Column] = MAX(Sheet7[Column]) && Sheet7[Year] = MAX(Sheet7[Year]) + [Parameter Value]
)
)
Please refer to my .pbix file.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @RFC_JWK ,
Please refer to my .pbix file.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-lionel-msft,
Thank you for your message. This works as long as the order does not change, but not when trying to compare two non-subsequent years, which is how the data should be presented in my case. Do you know if this is possible?
Best regards,
Jan
Hi @RFC_JWK ,
For example, if you want to compare the sales value of 2015 and 2017, you can change the parameter in this formula to 2。
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @RFC_JWK ,
Has your problem been solved?
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Lionel,
Unfortunately it has not yet been solved. This would require the user to manually change the formula when selecting different years for the comparison.
Best regards,
Jan
Hi @RFC_JWK ,
You can create a 'What if' parameter and modify the [Measure2].
Measure 2 =
CALCULATE(
SUM(Sheet7[Sales]),
FILTER(
ALLSELECTED(Sheet7),
Sheet7[Column] = MAX(Sheet7[Column]) && Sheet7[Year] = MAX(Sheet7[Year]) + [Parameter Value]
)
)
Please refer to my .pbix file.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @RFC_JWK ,
look at this.
Technique to improve Power BI report perf by reducing visuals
https://www.youtube.com/watch?v=kkIXtvU1AiM