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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Create Measure Unaffected by Slicer(s)

I have a dataset similar to below. Each row represents an event and the Count column is always populated with a (numeric) 1.

 

I'm trying to create two measures counting the number of events, one that's affected by slicers on EventType and Flag_YN, the other affected by Flag_YN only. It should be fairly simple but I just can't get it to work. 

 

For example, if a user has Flag_YN = Y and EventType = A, what I would like displayed is "2" and "8".

 

I've tried:

EventLevel = CALCULATE(SUM(Table[Count]),ALLEXCEPT(Table,Table[Flag_YN],Table[EventType]))

EventLevel = CALCULATE(VALUES(Table[Count]),ALLEXCEPT(Table,Table[Flag_YN],Table[EventType]))

EventLevel = CALCULATE(COUNTROWS(Table),ALLEXCEPT(Table,Table[Flag_YN],Table[EventType]))

 

Also tried the above with REMOVEFILTERS. For the Flag_YN level measure I tried the above with the EventType portion removed.

 

No matter what I try both measures change with the EventType slicers and end up displaying the same numbers. What am I overlooking here? Would appreciate any help.

 

EventIDEventTypeFlag_YNCount
236AY1
336AY1
180BY1
41BY1
455BN1
454CY1
203DN1
79DY1
367DY1
94DY1
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood correctly your question, but please check the below picture and the attached pbix file.

 

Picture1.png

 

first measure: = 
CALCULATE (
    COUNTROWS ( Data ),
    ALLEXCEPT ( Data, Data[EventType], Data[Flag_YN] )
)

 

second measure: = 
CALCULATE (
    COUNTROWS ( Data ),
    ALLEXCEPT ( Data, Data[Flag_YN] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks, not sure what I was doing wrong but creating a new set of measures using those formulas seemed to do the trick.

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood correctly your question, but please check the below picture and the attached pbix file.

 

Picture1.png

 

first measure: = 
CALCULATE (
    COUNTROWS ( Data ),
    ALLEXCEPT ( Data, Data[EventType], Data[Flag_YN] )
)

 

second measure: = 
CALCULATE (
    COUNTROWS ( Data ),
    ALLEXCEPT ( Data, Data[Flag_YN] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors