Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Modify Created Measure to Ignore a Page Slicer

Hi,

 

I have a Created Measure that is working correctly [Asthma M%].  However, I need to create an additional created measure that is essentially the same...but that ignores the Page Slicer [Group_ID].

 

Here is my existing Created Measure:

Asthma M% = DIVIDE(CALCULATE(DISTINCTCOUNT('Data Files'[MBR_ID]), Filter('Data Files','Data Files'[Asthma_IND] = "Asthma")),(CALCULATE(DISTINCTCOUNT('Data Files'[MBR_ID]))))
 
Currently...my Created Measure [Asthma M%] updates correctly when I change the Page Slicer [Group_ID] from one group to the next.
 
I'd like to create a new created measure very silimar to [Asthma M%]...but that simply ignores when I change the [Group ID] Page Slicer.
 
From what I've found...I think I need to use an ALLEXCEPT function somewhere in the new created measure...but I've struggled with how to implement it.
 
Can you please assist?
  • Anonymous , Try like


    Asthma M% = CALCULATE(DIVIDE(CALCULATE(DISTINCTCOUNT('Data Files'[MBR_ID]), Filter('Data Files','Data Files'[Asthma_IND] = "Asthma")),(CALCULATE(DISTINCTCOUNT('Data Files'[MBR_ID])))), all(Table [Group_ID]))

     

    But if it is page level filter , than I doubt it will work

2 Replies

  • Anonymous , Try like


    Asthma M% = CALCULATE(DIVIDE(CALCULATE(DISTINCTCOUNT('Data Files'[MBR_ID]), Filter('Data Files','Data Files'[Asthma_IND] = "Asthma")),(CALCULATE(DISTINCTCOUNT('Data Files'[MBR_ID])))), all(Table [Group_ID]))

     

    But if it is page level filter , than I doubt it will work

  • Anonymous 

    You have a bit of extra code in your first measure and you should avoid filtering an entire table and just filter the column you need, like so.

    Asthma M% =
    DIVIDE (
        CALCULATE (
            DISTINCTCOUNT ( 'Data Files'[MBR_ID] ),
            FILTER (
                VALUES ( 'Data Files'[Asthma_IND] ),
                'Data Files'[Asthma_IND] = "Asthma"
            )
        ),
        DISTINCTCOUNT ( 'Data Files'[MBR_ID] )
    )

    Then, for the all groups version you could do.

    Astma M% All Groups =
    CALCULATE ( [Astma M%], ALL ( 'Data Files'[Group ID] ) )