Forum Discussion

DJSwezey's avatar
DJSwezey
Icon for Helper I rankHelper I
2 years ago
Solved

How to show only subtotal value

I have a table that contains Country, State, Target Regions and number of dairy cows.

 

I do not want to see the number of dairy cows per each target region (last drill down row). I only want to see totals for State and for Country.

 

Any suggestions?

 

  • Option 1, don't use target region in your visual. Option 2, write a DAX measure to only sum when it's not in context of target region. Something like Dairy Cows = IF( ISFILTERED( [Target Region] ) , BLANK() , SUM( [Dairy Cows] ) )

4 Replies

  • CoreyP's avatar
    CoreyP
    Icon for Solution Sage rankSolution Sage

    Option 1, don't use target region in your visual. Option 2, write a DAX measure to only sum when it's not in context of target region. Something like Dairy Cows = IF( ISFILTERED( [Target Region] ) , BLANK() , SUM( [Dairy Cows] ) )

    • Bhaktishete's avatar
      Bhaktishete
      New Member

       

      Create a measure to calculate the total number of dairy cows for each state. Use the following DAX measure:

      Total Dairy Cows = SUM('YourTable'[Number of Dairy Cows])

      Create a measure to calculate the total number of target regions for each state. Use the following DAX measure:

      Total Target Regions = COUNTROWS(VALUES('YourTable'[Target Regions]))

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

        Im not sure what this is solving for?

        If I am using a measure as my value for number of Dairy Cows and Beef Cows then I cannot drill down to the Target Region by State.

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

      This works great with only one acception: now I have nothing to drill down onto. When I use the measure as my value I cannot drill down into a Target Region