This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi all,
My goal is to show multiple YoY%-Changes lines in a line chart based on a (multiple)selection of a field paramter.
I do have multiple measures that all show the sum of different columns.
E.G.
Sales = SUM(Table['Sales'])
Orders = SUM(Table['Orders'])
...
I could create for each of these measure a new measure with the calculation like - but i want to avoid having to create like 20 of these measures:
Sales_YoY% =
VAR __CV = [Sales]
VAR __PV = CALCULATE([Sales],SAMEPERIODLASTYEAR('Date'[Date]))
VAR __DIFF = __CV-__PV
RETURN
DIVIDE(__DIFF,__PV, BLANK())
When i use calculation groups it does work with a table/matrix visual. However if i try to use it on a bar or line chart it only works if i select a single measure - which makes sense - i guess - as it uses SELECTEDMEASURE().
I tried to put the "parameter" on the Y-Axis and the "calculation item" on the legend.
Code for Calculation Group:
YoY% =
VAR __CV = SELECTEDMEASURE()
VAR __PV = CALCULATE(SELECTEDMEASURE(),SAMEPERIODLASTYEAR('Date'[Date]))
VAR __DIFF = __CV-__PV
RETURN
DIVIDE(__DIFF,__PV, BLANK())
Is there any way to manipulate multiple measures without creating a new measure for each of them?
Thanks.
Hi @BoSe2828 - you can utilize calculation groups , to get the multiple Year-over-Year (YoY%) change lines in a single Power BI line chart based on the selection of multiple field parameters, without creating individual YoY measures for each one.
example:
YoY% =
VAR __CV = SELECTEDMEASURE()
VAR __PV = CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Date'[Date]))
VAR __DIFF = __CV - __PV
RETURN
DIVIDE(__DIFF, __PV, BLANK())
This calculation group will dynamically apply the YoY% calculation to any measure in the model that is used in the visual.
This solution may face limitations when visualizing multiple measures simultaneously because SELECTEDMEASURE() applies to a single measure. If you're selecting multiple measures and expect to see multiple lines in the same chart, you might need to adapt the setup to handle dynamic measure switching better.
you can use variables in the calculation group to conditionally calculate multiple measures in one visual and apply the YoY% calculation without separating them into individual measures.
Hope the above information helps in your scenerio
Proud to be a Super User! | |
Hi @rajendraongole1 ,
as mentioned I'm already using a calculation group and it works fine with a table or matrix visual. My issues comes with displaying mutliple lines/columns in a line or column chart.
Hi, @BoSe2828
I've tested and can't use calculation groups to display multiple lines in a line chart. Separate neasure are still needed, and each measure can correspond to a line.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 32 | |
| 26 | |
| 25 | |
| 24 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 48 | |
| 27 | |
| 23 | |
| 20 |