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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
tdoggett
Frequent Visitor

Attempting to create a measure that has to be sliced twice.

I have data that is catagorized in three catagories.  For one card I want to sum the values of A For the second Card I want B and C.  For my third card I want the difference between Card 1 and Card 2.  However the category is dynamic and above each card is a slicer with the categories.  The measure I have works fine if slicing for one value however when slicing both cards I end up with the word blank in the third card.

5 REPLIES 5
nickchobotar
Skilled Sharer
Skilled Sharer

@tdoggett

 

Do you have ALLSELECTED () function in your DAX logic ?

I do and when the same categories are selected it works correctly

This is correctThis is correctIncorrectIncorrect

 

 

Hi @tdoggett,

 

I think you issue may be related to the Slicer interactions settings. Please verify it.

 

And I have made some test, everything works fine. Please refer:

 

Card 1 and Card 2 are like: 

Card 1 =
CALCULATE (
    SUM ( 'Table 1'[values] ),
    ALLSELECTED ( 'Table 1' ),
    ALLEXCEPT ( 'Table 1', 'Table 1'[Ranking] )
)

Also use measure to get the current Slicer value:

Slicer 1 =
IF ( HASONEVALUE ( 'Table 1'[Ranking] ), VALUES ( 'Table 1'[Ranking] ) )

Then Card 1 - Card 2:

Card 1 - Card 2 =
CALCULATE (
    SUM ( 'Table 1'[values] ),
    FILTER ( 'Table 1', 'Table 1'[Ranking] = [Slicer 1] )
)
    - CALCULATE (
        SUM ( 'Table 2'[values] ),
        FILTER ( 'Table 2', 'Table 2'[Ranking] = [Slicer 2] )
    )

11.PNG22.PNG

 

If you issue isn't related to interactions setting. Could you please share us more detailed information about your report like the measure expressions? 

 

Thanks,
Xi Jin.

 

This is defintely the right way to start approching this thanks for your response

 

Here are the expressions that I am using

 

Card 1 = SUM('Invoice Details'[Invoice Volume]) * SUM('Costs'[B'S Cost])

Card 2 = SUM('Invoice Details'[Invoice Volume]) * SUM('Costs'[T'S Cost])

Card 1 minus Card 2 = 'Invoice Details'[Card 1] - 'Invoice Details'[Card 2]

Hi @tdoggett,

 

Have you created any relationships netween table Invoice Details and table Costs? The relationships will affect the result of using slicer.

 

Also, could you please share us some sample data which can help us repro your issue if possible? So that we can find the right direction and make some proper tests.

 

Thanks,
Xi Jin.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors