Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am trying to calculate variance in the same column by using two different month slicers. The DAX gives variance as zero when I am selecting same months but showing blank when different months are selected. Is there any way to calculate row to row subtraction when same column is selected via different month slicers. Also the month column is appended data and has repeated values.
Solved! Go to Solution.
Hi @aks_jo ,
Since you didn't provide sample data, I had to create a sample data myself to test it:
And I suggest you to add two tables for slicers:
Without any relationships:
Then I use this DAX to create a measure:
Difference =
VAR Month_From = SELECTEDVALUE(Slicer1[Month_From])
VAR Month_To = SELECTEDVALUE(Slicer2[Month_To])
VAR Value_From =
CALCULATE(
SUM('Table'[Actual TPD 1]),
MONTH('Table'[Date]) = Month_From
)
VAR Value_To =
CALCULATE(
SUM('Table'[Actual TPD 1]),
MONTH('Table'[Date]) = Month_To
)
RETURN
Value_From - Value_To
And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @aks_jo ,
Since you didn't provide sample data, I had to create a sample data myself to test it:
And I suggest you to add two tables for slicers:
Without any relationships:
Then I use this DAX to create a measure:
Difference =
VAR Month_From = SELECTEDVALUE(Slicer1[Month_From])
VAR Month_To = SELECTEDVALUE(Slicer2[Month_To])
VAR Value_From =
CALCULATE(
SUM('Table'[Actual TPD 1]),
MONTH('Table'[Date]) = Month_From
)
VAR Value_To =
CALCULATE(
SUM('Table'[Actual TPD 1]),
MONTH('Table'[Date]) = Month_To
)
RETURN
Value_From - Value_To
And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |