Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to make Fixed Totals & Subtotals (filter independent)

How to make Fixed Totals & Subtotals?

Example (two identical matrix -  just row order is different): 

DenisSipchenko_0-1679405296478.png

 

Problem: when I filter by year or product, subtotals are recalculated, but I want to see global fixed subtotals (by another words the same subtotals as on screen above)

DenisSipchenko_1-1679405646207.png

Is it possible?

Download Source File 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Possible Solution:

 

 

VolumeTotal(Fixed Totals) = 
VAR isInSc_Prod = ISINSCOPE(dimSalesYearly[*idProduct])
VAR isInSc_Year = ISINSCOPE(dimSalesYearly[*Year])
VAR Result =
    SWITCH(
        TRUE(),
        NOT isInSc_Prod && NOT isInSc_Year, CALCULATE(SUM(dimSalesYearly[VolumeTotal]), REMOVEFILTERS(dimSalesYearly[*idProduct],dimSalesYearly[*Year])),
        NOT isInSc_Prod , CALCULATE(SUM(dimSalesYearly[VolumeTotal]), REMOVEFILTERS(dimSalesYearly[*idProduct])),
        NOT isInSc_Year , CALCULATE(SUM(dimSalesYearly[VolumeTotal]), REMOVEFILTERS(dimSalesYearly[*Year])),
        SUM(dimSalesYearly[VolumeTotal])
    )

RETURN Result

 

 

DenisSipchenko_1-1679500242899.png

 


P.S. I'd appreciate if you support "PowerQuery: Special symbol for previous step name" request feature you vote here or LinkedIn like/repost here.

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Possible Solution:

 

 

VolumeTotal(Fixed Totals) = 
VAR isInSc_Prod = ISINSCOPE(dimSalesYearly[*idProduct])
VAR isInSc_Year = ISINSCOPE(dimSalesYearly[*Year])
VAR Result =
    SWITCH(
        TRUE(),
        NOT isInSc_Prod && NOT isInSc_Year, CALCULATE(SUM(dimSalesYearly[VolumeTotal]), REMOVEFILTERS(dimSalesYearly[*idProduct],dimSalesYearly[*Year])),
        NOT isInSc_Prod , CALCULATE(SUM(dimSalesYearly[VolumeTotal]), REMOVEFILTERS(dimSalesYearly[*idProduct])),
        NOT isInSc_Year , CALCULATE(SUM(dimSalesYearly[VolumeTotal]), REMOVEFILTERS(dimSalesYearly[*Year])),
        SUM(dimSalesYearly[VolumeTotal])
    )

RETURN Result

 

 

DenisSipchenko_1-1679500242899.png

 


P.S. I'd appreciate if you support "PowerQuery: Special symbol for previous step name" request feature you vote here or LinkedIn like/repost here.

 

 

Hi @Anonymous ,

Thanks for sharing the solution. If the problem has been resolved, could you please mark your post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

By the way, I just voted for your idea. It is a good idea, hope it can be realized in the near future.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors