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
AgeOfEgos
Helper I
Helper I

Distinct Count with ALL function to ignore slicer not working

I have a slicer that has a drop down of possible services a patient will receive.  I have a measure that counts ALL patients regardless of service, then another measure that counts only the selected service distinct patients.  The idea is, I can then produce a % of patients that receive that service.  

 

While my service disctinct count measure works, the measure doing a distinct count ignoring the service slicer does not.  Here is my code:

 

ALLPATIENTS = CALCULATE(DISTINCTCOUNT(Sheet1[Name]),ALL(Sheet1[Service]))

However, if I select a service from the slider--the card that has the above measure attached will change to reflect that selection.  

 

Thanks for any help!

1 ACCEPTED SOLUTION

@AgeOfEgos,

 

Take a look at Change how visuals interact in a report and select the no impact icon.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
NAOS
Helper IV
Helper IV

Hi,

Easiest way to solve it is to create a calendar table and use that as your report slicer. You will also have to create tables for other attributes when necessary. DAX is powerful but needs a good data model in behind to work in a more predictable way.

And use this measure. 

ALLPATIENTS = CALCULATE(DISTINCTCOUNT(Sheet1[Name]),ALL(Sheet1))

That should do.

Kind regards,

AgeOfEgos
Helper I
Helper I

@AgeOfEgos,

 

There is another slicer. Just use ALL ( Sheet1 ).

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That did work as a test--but I need the date slicer to still effect that total.  Just not the service slicer

@AgeOfEgos,

 

Take a look at Change how visuals interact in a report and select the no impact icon.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

and yeah I've tried ALLEXCEPT(Sheet1, Sheet1[Date]) but the moment I put an ALL or ALLEXCEPT back on that measure--it starts using the Service slicer again.

v-chuncz-msft
Community Support
Community Support

@AgeOfEgos,

 

If the field dragged to slicer comes from another table that has relationship to Sheet1, you may change it to ALL ( Table2[Service] ).

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Only one table in the file

MFelix
Super User
Super User

Hi @AgeOfEgos,

 

I don't see any issues with the measure you have and should work as expected can you give some more insight on the model.

 

Is the slicer you are using from the same table?

Are you placing the correct meausre on the card you are visualizing?

 

Can you share some sample file.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.