0

I have a table with quarterly volume data, and a slicer that allows you to choose what quarter/year you want to see volume per code for. The slicer has 2019Q1 through 2021Q4 selections. I need to create dynamic difference column that will adjust depending on what quarter/year is selected in the slicer. I know I need to create a new measure using Calculate/filter but am a beginner in PowerBI and am unsure how to write that formula.

Example of raw table data:

Code 2019Q1 2019Q2 2019Q3 2019Q 2020Q1 2020Q2 2020Q3 2020Q4
11111 232 283 289 19 222 283 289 19
22222 117 481 231 31 232 286 2 19
11111 232 397 94 444 232 553 0 188
22222 117 411 15 14 232 283 25 189

Example if 2019Q1 and 2020Q1 are selected:

Code 2019Q1 2020Q1 Difference
11111 232 222 10
22222 117 481 -364
11111 232 397 -165
22222 117 411 -294
0

1 Answer 1

0

Power BI doesn't work that way. This is an Excel pivot table setup. You don't have any parameter to distinguish first and third or second and fourth row. They have the same code, so Power BI will aggregate their volumes. You could introduce a hidden index column but then why don't you simply stick to Excel? The Power BI approch to the problem would be to unpivot (stack) your table to a Code, Quarter and a Volume column, create 2 independent slicer tables for Minuend and Subtrahend and then CALCULATE your aggregated differences based on the SELECTEDVALUE of the 2 slicers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.