Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I am looking to calculate a % change over mutliple data sets. Essentially I have a file for each month with a certain amount of forecast. I want to be able to calcualte the difference between each month, but have it be flexible. So instead of having a multiple measures that compares January to Febuary and then January to March and so on, I would like to see if it's possible that I could select the comparisons I want it to do. For instance, compare March to June, or January to December. Something that is more live than stagnant. I pasted my current formula below to get a stagnant outcome, but want something more live if possible.
Solved! Go to Solution.
Hi @kfitzek ,
To calculate a dynamic percentage change between any two months in your forecast data, you should first ensure your model uses a normalized structure with a proper Date column and a related calendar table. Assuming you’ve unpivoted your forecast data so that each row has a Date and Forecast value, and you've created a DateTable with continuous dates and related it to your forecast table on the Date column, you can then introduce two disconnected copies of the DateTable for comparison. These disconnected tables will allow users to select the base and comparison dates using slicers without interfering with the main model filters.
You can then write the following DAX measure:
% Change Between Selected Dates =
VAR BaseDate = SELECTEDVALUE('DateTable_Base'[Date])
VAR CompareDate = SELECTEDVALUE('DateTable_Compare'[Date])
VAR BaseValue =
CALCULATE(
SUM('ForecastTable'[Forecast]),
'DateTable'[Date] = BaseDate
)
VAR CompareValue =
CALCULATE(
SUM('ForecastTable'[Forecast]),
'DateTable'[Date] = CompareDate
)
RETURN
IF(
NOT ISBLANK(CompareValue) && NOT ISBLANK(BaseValue),
DIVIDE(CompareValue - BaseValue, BaseValue)
)
This approach uses clean modeling, avoids hardcoding, and leverages a proper date relationship for accuracy and flexibility. Users can now choose any two months or dates using slicers tied to the disconnected base and comparison date tables, and the measure will compute the percentage change between the corresponding forecast values dynamically.
Best regards,
Hi @kfitzek ,
To calculate a dynamic percentage change between any two months in your forecast data, you should first ensure your model uses a normalized structure with a proper Date column and a related calendar table. Assuming you’ve unpivoted your forecast data so that each row has a Date and Forecast value, and you've created a DateTable with continuous dates and related it to your forecast table on the Date column, you can then introduce two disconnected copies of the DateTable for comparison. These disconnected tables will allow users to select the base and comparison dates using slicers without interfering with the main model filters.
You can then write the following DAX measure:
% Change Between Selected Dates =
VAR BaseDate = SELECTEDVALUE('DateTable_Base'[Date])
VAR CompareDate = SELECTEDVALUE('DateTable_Compare'[Date])
VAR BaseValue =
CALCULATE(
SUM('ForecastTable'[Forecast]),
'DateTable'[Date] = BaseDate
)
VAR CompareValue =
CALCULATE(
SUM('ForecastTable'[Forecast]),
'DateTable'[Date] = CompareDate
)
RETURN
IF(
NOT ISBLANK(CompareValue) && NOT ISBLANK(BaseValue),
DIVIDE(CompareValue - BaseValue, BaseValue)
)
This approach uses clean modeling, avoids hardcoding, and leverages a proper date relationship for accuracy and flexibility. Users can now choose any two months or dates using slicers tied to the disconnected base and comparison date tables, and the measure will compute the percentage change between the corresponding forecast values dynamically.
Best regards,
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |