Forum Discussion
Calculating variance from multiple columns from the same table
- 3 years ago
P_P2595 , Unpivot the all column other than Id and description , then you can have measures like
M1 = calculate(Average(Table[Value]), filter(Table, Table[Description] ="Start") )
M2= calculate(Average(Table[Value]), filter(Table, Table[Description] ="End") )
Diff = [M1] -[M2]
Learn Power BI: Power Query UnPivot Data, Pivot Data, Transpose Data, Query Fill Up, Fill Down: https://www.youtube.com/watch?v=cN8AO3_vmlY&t=36407s
Unpivot Data(Power Query): https://youtu.be/2HjkBtxSM0g
- 3 years ago
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26RiGy6Yf6quAn_ATjG?e=zsB0R6 - 3 years ago
Hi,
Please find attached my solution file.
Hope this helps.
Hi all,
Thanks for your solutions and it’s working for me. Is it possible to get the same output without unpivoting the columns as I have some pages and visuals with that table and extra columns than the input data and I don't want to unpivot the data because it's affecting other pages and visuals.
Is there any other way to get the expected output by creating a measure and calculated column?
Thank you so much.
Greatly appreciate your answers.