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 trying to compare two measures; one that is affected by a calculation group, and one that is not affected by the calculation group. The calculation item is written as follows:
Then I have two identical measures, where one of them has _calc in it's name.
Measure that is not to be affected:
Measure to be affected:
Now I try to calculate the difference between them.
Calculation item not filtered (works as expected as the numbers are the same):
Calculation item filtered (and NOT working as expected, as the numbers now are different, but still get 0 in "Diff":
How do I get Power BI to understand that the _calcRevenueActual has another value after the calculation item has been filtered?
Thanks in advance!
Solved! Go to Solution.
Hi @ThomasCh,
Thank you for reaching out to the Microsoft fabric community forum.
I have reproduced your scenario in Power BI Desktop and successfully achieved the expected output as per your requirements. To summarize:
To achieve this, I:
For your reference, I’m attaching the .pbix file containing the solution. You can download it and review the setup to apply it to your report.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Hi @ThomasCh,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @ThomasCh,
May I ask if you have resolved this issue? If so, please mark it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @ThomasCh,
Thank you for reaching out to the Microsoft fabric community forum.
I have reproduced your scenario in Power BI Desktop and successfully achieved the expected output as per your requirements. To summarize:
To achieve this, I:
For your reference, I’m attaching the .pbix file containing the solution. You can download it and review the setup to apply it to your report.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Hi @ThomasCh,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so other community members with similar problems can find a solution faster.
Thank you.
Once the calculation group has been applied to the Diff measure it will not be applied again for any measures which Diff calls. You need to not apply the calculation group to the diff measure and manually apply it inside the measure, e.g.
Diff =
[Revenue Actual]
- CALCULATE (
[Revenue Actual],
TREATAS ( { "LY" }, 'Time Calculations'[Time Calculations] )
)
Hi @ThomasCh ,
You’re super close! The problem is that your calculation group still affects your [Diff] measure, because when you do something like [Revenue actual] - [_calc.RevenueActual], the calculation group logic gets applied to each part separately—even if you only want it on one.
Solution:
To stop the calculation group from affecting your [Diff] measure, you need to add a check in your calculation group’s DAX so that it only runs for the measures you want.
For example, update your calculation item like this:
IF( CONTAINSSTRING(SELECTEDMEASURENAME(), "_calc") && SELECTEDMEASURENAME() <> "Diff", // Exclude the Diff measure CALCULATE( SELECTEDMEASURE(), PARALLELPERIOD('DimDate'[Date], -12, MONTH) ), SELECTEDMEASURE() )
Or, if your [Diff] measure is a calculated measure, you could check for a pattern or use another logic to exclude it.
TL;DR:
Add an extra check so your calculation group doesn’t fire on [Diff]. That way, only the measures you want get affected by the time calculation.
Let me know if you need a more specific example!
translation and formatting supported by AI
Hi and thanks for the reply!
Unfortunately it doesn't seem to work.
Updated calculation item:
Diff measure:
I still get 0 in diff:
Hi @ThomasCh ,
Your calculation group logic is still being applied when you use [Diff], because [Diff] references [_calc.RevenueActual], so the calculation group ends up firing on that measure anyway.
Try this approach:
Instead of referencing [_calc.RevenueActual] directly in [Diff], use SELECTEDMEASURE() logic inside the calculation group to return BLANK() if the selected measure is [Diff].
But, since [Diff] is calling the _calc measure, the calculation group will still process it. To avoid this, you might need to “shield” [Diff] from the calculation group by restructuring things a bit.
Here’s what you can do:
Create a base measure (not affected by calculation group):
Revenue actual (Base) = CALCULATE( SUM(FactFinanceActual[Amount]), LEFT(DimAccount[AccountGroup],1) = "3" )
Have your _calc measure reference the base:
_calc.RevenueActual = [Revenue actual (Base)]
Your Diff measure:
Diff = [Revenue actual (Base)] - [_calc.RevenueActual]
Update your calculation group logic to only affect measures ending with "_calc" and NOT [Diff] or [Revenue actual (Base)]:
IF( CONTAINSSTRING(SELECTEDMEASURENAME(), "_calc") && SELECTEDMEASURENAME() <> "Diff", CALCULATE( SELECTEDMEASURE(), PARALLELPERIOD('DimDate'[Date], -12, MONTH) ), SELECTEDMEASURE() )
Key Point:
Make sure [Diff] and [Revenue actual (Base)] are never picked up by the calculation group’s logic. Only [_calc.RevenueActual] should be affected. By structuring it this way, [Diff] will always be the difference of the "raw" values.
Let me know if this does the trick or if you see any weird results. If you still have trouble, share your calculation group’s exact logic and we can troubleshoot further!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |