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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Make DISTINCTCOUNT Measure ignore slicer

I have a table with multiple entries per user. Each entry represents an event (though that info is not relevant for this question).

user_idfilter
12330
123180
35530
35560
49090

 

The filter column determines if the event was sent X or less days ago. That is:

  1. 30 if the event was sent 30 or less days ago
  2. 60 if the event was sent between 31 and 60 days ago
  3. 90 if the event was sent between 61 and 90 days ago
  4. 60 if the event was sent between 91 and 180 days ago

I use this column as a Slicer to allow the user to select certain periods of time.

I made the following measure to count the number of users that have logged at least one event in the last X days (based on the value that the user sets the slicer to):

events_filtered = DISTINCTCOUNT(my_table[user_id])

I now want to create a measure that is not affected by the slicer. That is, a distinct count that ignores the slicer.
At first, I thought I could modify the interactions. However, I want to display both measures in a Multi-row card visual. Hence, how can I create a measure that calculates the grand total of the unique users in the table?
1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @Anonymous ,

 

you can ignore a slicer with the ALL function. This function you can use as a context modifier in the CALCULATE function.

So the following approach should give you the result you want:

events_filtered =
CALCULATE (
    DISTINCTCOUNT ( my_table[user_id] ),
    ALL ( filter_Table[filter] )
)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

View solution in original post

1 REPLY 1
selimovd
Super User
Super User

Hey @Anonymous ,

 

you can ignore a slicer with the ALL function. This function you can use as a context modifier in the CALCULATE function.

So the following approach should give you the result you want:

events_filtered =
CALCULATE (
    DISTINCTCOUNT ( my_table[user_id] ),
    ALL ( filter_Table[filter] )
)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.