Forum Discussion

angevin17's avatar
angevin17
Microsoft Employee
5 years ago
Solved

Using a measure with filtered data

Hello,

 

I have a measure that adds up a column and then divides each row in that column by the total of the column (calculating percentage). However, when I filter by a different column, the original total of the column changes. I am trying to make it so the total of the column will not change even when filters are applied.

 

I want it to look like the yellow where if you filter something out, it will still take that number into account when computing the total. Hoping to modify my measure/create a new one that can do this.

 

 

Thank you for all the help!!

  •  

    Percent measure : =
    VAR _allcount =
    CALCULATE ( SUM ( Data[Count] ), REMOVEFILTERS ( Offers[OfferName] ) )
    VAR _count =
    SUM ( Data[Count] )
    VAR _result =
    DIVIDE ( _count, _allcount )
    RETURN
    _result

     

     

    Link to the sample pbix file 

     

     

2 Replies

  •  

    Percent measure : =
    VAR _allcount =
    CALCULATE ( SUM ( Data[Count] ), REMOVEFILTERS ( Offers[OfferName] ) )
    VAR _count =
    SUM ( Data[Count] )
    VAR _result =
    DIVIDE ( _count, _allcount )
    RETURN
    _result

     

     

    Link to the sample pbix file