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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello,
I have the following scenario which is not working in DAX Calculations
I have also mentioned the used Measure below the following image.
Cancelled Counts =
VAR Total =
CALCULATE(
DISTINCTCOUNT('FinancialSummary'[ContactId]),
FILTER('FinancialSummary', 'FinancialSummary'[Membership Type] = 4)
) RETURN
IF(Total = BLANK(), 0, Total * -1)
General Counts =
VAR Total =
CALCULATE(
DISTINCTCOUNT('FinancialSummary'[ContactId]),
FILTER('FinancialSummary', 'FinancialSummary'[Membership Type] <> 4)
) RETURN
IF(Total = BLANK(), 0, Total)
Calculated Counts =
IF(SELECTEDVALUE('FinancialSummary'[Membership Type]) = 4, [Cancelled Counts], [General Counts])
Please provide the solution for this issue.
Thanks in Advance!
Solved! Go to Solution.
Hi @Jack09 ,
I suggest you to create a new measure using the function of SUMX. Then the sub total will be calculated correctly.
Measure = SUMX(FinancialSummary, FinancialSummary[Cancelled Counts])
The following is my sample. You can reference to modify yours.
Measure = VAR a = SUM(Table1[Values]) return IF(MAX(Table1[NSW]) = "Cancelled",a*-1,a) Measure 2 = SUMX(Table1,Table1[Measure])
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Jack09 ,
I suggest you to create a new measure using the function of SUMX. Then the sub total will be calculated correctly.
Measure = SUMX(FinancialSummary, FinancialSummary[Cancelled Counts])
The following is my sample. You can reference to modify yours.
Measure = VAR a = SUM(Table1[Values]) return IF(MAX(Table1[NSW]) = "Cancelled",a*-1,a) Measure 2 = SUMX(Table1,Table1[Measure])
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 57 | |
| 52 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 115 | |
| 106 | |
| 41 | |
| 34 | |
| 25 |