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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.