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
nb25064
Frequent Visitor

Unfiltered column subtotal

Hi everyone!

 

I'm trying to create a matrix that displays some measures filtered by a column and then, in the row subtotal I would like to have the unfiltered total for those measures. Is it possible?

teste.JPG

 

As you can see, I've some measures selected and a filtered column, but I'm struggling to find a way of showing this information as if it was a simple "Participant A vs ALL Participants".

I've already created those measures using the ALL function, to get the values that I want, but i'm still failing to show those measures in a visual that is easy to compare (like the above screenshot would be).

If unfiltering the subtotals is not possible, is there a workaround for this?

 

Thanks,

Lucas

 

 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @nb25064 

 

Based on your description, I created data to reproduce your scenario.

Table:

d1.png

 

You may create measures as below.

Abatido ao activo = 
IF(
    ISINSCOPE('Table'[Participant]),
    SUM('Table'[Value3]),
    CALCULATE(
        SUM('Table'[Value3]),
        ALL('Table')
    )
)
Capital em Divide = 
IF(
    ISINSCOPE('Table'[Participant]),
    SUM('Table'[Value1]),
    CALCULATE(
        SUM('Table'[Value1]),
        ALL('Table'[Participant])
    ) 
)
Rácio de Incumprimento = 
IF(
    ISINSCOPE('Table'[Participant]),
    SUM('Table'[principal_arrears_amount])/SUM('Table'[principal_amount]),
    CALCULATE(
        SUM('Table'[principal_arrears_amount])/SUM('Table'[principal_amount]),
        ALL('Table')
    )
)
Vencido = 
IF(
    ISINSCOPE('Table'[Participant]),
    SUM('Table'[Value2]),
    CALCULATE(
        SUM('Table'[Value2]),
        ALL('Table')
    )
)

 

Result:

d2.png

 

Best Regards

Allan

 

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

View solution in original post

6 REPLIES 6
v-alq-msft
Community Support
Community Support

Hi, @nb25064 

 

Based on your description, I created data to reproduce your scenario.

Table:

d1.png

 

You may create measures as below.

Abatido ao activo = 
IF(
    ISINSCOPE('Table'[Participant]),
    SUM('Table'[Value3]),
    CALCULATE(
        SUM('Table'[Value3]),
        ALL('Table')
    )
)
Capital em Divide = 
IF(
    ISINSCOPE('Table'[Participant]),
    SUM('Table'[Value1]),
    CALCULATE(
        SUM('Table'[Value1]),
        ALL('Table'[Participant])
    ) 
)
Rácio de Incumprimento = 
IF(
    ISINSCOPE('Table'[Participant]),
    SUM('Table'[principal_arrears_amount])/SUM('Table'[principal_amount]),
    CALCULATE(
        SUM('Table'[principal_arrears_amount])/SUM('Table'[principal_amount]),
        ALL('Table')
    )
)
Vencido = 
IF(
    ISINSCOPE('Table'[Participant]),
    SUM('Table'[Value2]),
    CALCULATE(
        SUM('Table'[Value2]),
        ALL('Table')
    )
)

 

Result:

d2.png

 

Best Regards

Allan

 

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

 Thanks to all, for all your help and replies! @v-alq-msft solution did the trick. 

 

amitchandak
Super User
Super User

@nb25064 ,

Refer if this can help

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

 

like

IF(ISFILTERED(Table[Type]),Sum(Table[Value]),calculate(Sum(Table[Value]),all(Table)))

IF(HASONEVALUE(Table[Type]),Sum(Table[Value]),calculate(Sum(Table[Value]),all(Table)))

AllisonKennedy
Super User
Super User

Hi Lucas~

 

Can you explain further what you are trying to acheive? Is the screenshot you shared the desired result or are you looking for the totals column to reflect something different?

 

@nb25064 Also, can you share the DAX for your measures that you're currently using?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

About the measures:

Rácio de Incumprimento = SUM(fact_contracts[principal_arrears_amount])/Sum(fact_contracts[principal_amount])
Normal = CALCULATE(TOTALYTD(SUM(fact_contracts[original_principal_amount]);'Dim_Date'[reference_dt]);dim_arrears_status[arrears_status_cd] ="000")
The other ones are just sums.
 
teste.JPG
 
What I'm trying to achieve is a way of showing how a participant is performing, comparing those measures (filtered for Participant A in this case) with the same measures but unfiltered(Total column). In the screenshot, the totals column is equal to Participant A, and that happens because were filtering for that Participant(Participant A), but I would like to have the sum of all participants for each measure.
 
I forgot to mention, those measures are appearing as rows because I've enabled the "show on rows" option.
 
teste2.JPG
 

@nb25064 Thanks for the clarification. 

 

Try @amitchandak 's suggestion of redefining the measure to include an IF check to see if the value is a single filter or subtotal, and if subtotal to ignore the filters:

Rácio de Incumprimento = IF(HasOneValue([participant]), SUM(fact_contracts[principal_arrears_amount])/Sum(fact_contracts[principal_amount]), calculate(SUM(fact_contracts[principal_arrears_amount])/Sum(fact_contracts[principal_amount]), ALL([participant]))
 
Or if you want to split into 2 measures:
Keep your existing measure:
Normal = CALCULATE(TOTALYTD(SUM(fact_contracts[original_principal_amount]);'Dim_Date'[reference_dt]);dim_arrears_status[arrears_status_cd] ="000")
Then Create New Measure:
Normal Total = IF(HasOneValue([Participant]), [Normal], CALCULATE([Normal], ALL([Participant])))
 
I don't know the name of the Table[Column] which holds the participant information so you'll need to replace that, and also fix syntax to match your region, but use those new measures in the table and you should get the results you're looking for. 
 

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos.

I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 

https://sites.google.com/site/allisonkennedycv


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.