Forum Discussion

ys034's avatar
ys034
Icon for Helper I rankHelper I
4 years ago
Solved

Calculation should not change during specific filter selection

Hello community I am learning DAX new recently

 

I have a question about ignoring a calculation based on the filter criteria
As you can see on the picture the market shares are calculated correctly.
When I select Brand a it shows me 100% but I want it to show me 35% like in the first picture.

 

I would be very happy about an answer

  • How about something simpler?

    CALCULATE (
        SUM ( 'DataTable'[Sales] ),
        ALL ( 'DataTable'[Brand] )
    )

5 Replies

  • ys034 , For grand total you might have created a measure

    calculate([Measure], allselected())

     

    Use all in place of that

    calculate([Measure], all())

     

    or

     

    calculate([Measure], all(TableName))

    • ys034's avatar
      ys034
      Icon for Helper I rankHelper I

      My Measure: 

      Grand Total Sales = CALCULATE(SUMX(VALUES('DataTable'),'DataTable'[Sales]),filter(ALLSELECTED('DataTable'), 'DataTable'[Date].[Year] = max('DataTable'[Date].[Year])),FILTER(ALLSELECTED('DataTable'),'DataTable'[Country] = MAX('DataTable'[Country])),ALLSELECTED())
       
      This is my new measure but it doesn't work. Any other ideas?
      • AlexisOlson's avatar
        AlexisOlson
        Icon for Super User rankSuper User

        How about something simpler?

        CALCULATE (
            SUM ( 'DataTable'[Sales] ),
            ALL ( 'DataTable'[Brand] )
        )
  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi ys034 

     

    Have you tried Alexis's formula for Grand Total? It should work I think. 

     

    Best Regards,
    Community Support Team _ Jing