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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
AW1976NOVA
Post Patron
Post Patron

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?
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AW1976NOVA , 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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@AW1976NOVA , 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

jdbuchanan71
Super User
Super User

@AW1976NOVA 

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] ) )

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.