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
Joris_NL
Helper II
Helper II

Dax measure to ignore the report filter of a different (related) table

 

After many attempts I still can't work this one out.

 

I have a report filter on Observations[user]. This has to apply to all pages, including the one of the measure below, to show only the performance of one selected user. This works fine so far.

 

Next, in order to calculate the progress of the selected user, I want to compare his performance to the world total species. This could for example be: 120 species found by user, 1000 species worldwide, so this user would be at 12% progress.

 

I've tried the measure below to calculate those 1000 species worldwide:

 

 

 

 

 

 

Total species worldwide = 
CALCULATE(
    DISTINCTCOUNT( Taxonomy[id] ) ,
        REMOVEFILTERS( Observations[user] ) , 
        FILTER( Taxonomy , 
        Taxonomy[Rarity] <> 0 
        && Taxonomy[Rarity] <> 4 
        && Taxonomy[Status] = "Native"
        && Taxonomy[Type] = "S") 
)

 

 

 

 

 

 

But REMOVEFILTERS doesn't work. The outcome of this measure is 120 species worldwide. The report filter on Observations[user] still applies, and filters the related Taxonomy table. Any user's progress becomes 100%.

 

Help please!

1 ACCEPTED SOLUTION

Thanks. Though not exactly like you intended, I removed the filter to a new calculation level. It worked.

 

 

Total species worldwide = 
CALCULATE(
    CALCULATE ( 
        DISTINCTCOUNT( Taxonomy[id] ) ,
        FILTER( Taxonomy , 
        Taxonomy[Rarity] <> 0 
        && Taxonomy[Rarity] <> 4 
        && Taxonomy[Status] = "Native"
        && Taxonomy[Type] = "S") 
    ) ,
    REMOVEFILTER ( Data[user] ) 
)

 

View solution in original post

4 REPLIES 4
Gabry
Responsive Resident
Responsive Resident

Did you already tried using ALL on Taxonomy or Observations[user]  instead of removefilter?

Yes, I tried:

  • ALL ( Taxonomy) 
  • ALL ( Observations[user] )
  • ALL ( Observations )
  • ALL ( Observations ) , ALL ( Taxonomy)  

...in place of removefilter.

 

They all have no effect. The report filter on Observartions[user] still applies on the number of total world species (showing 120 instead of 1000).

Example:

 

Total species worldwide = 
CALCULATE(
    DISTINCTCOUNT( Taxonomy[id] ) ,
        ALL( Observations ) , ALL( Taxonomy ) , ALL ( ...every other table in the report... ),
        FILTER( Taxonomy , 
        Taxonomy[Rarity] <> 0 
        && Taxonomy[Rarity] <> 4 
        && Taxonomy[Status] = "Native"
        && Taxonomy[Type] = "S") 
)

 

Gabry
Responsive Resident
Responsive Resident

I don't know then, sounds strange, looks like some other filters are applied. Could you load the pbix?

Why also do you use filter inside calculate? try to remove it

Thanks. Though not exactly like you intended, I removed the filter to a new calculation level. It worked.

 

 

Total species worldwide = 
CALCULATE(
    CALCULATE ( 
        DISTINCTCOUNT( Taxonomy[id] ) ,
        FILTER( Taxonomy , 
        Taxonomy[Rarity] <> 0 
        && Taxonomy[Rarity] <> 4 
        && Taxonomy[Status] = "Native"
        && Taxonomy[Type] = "S") 
    ) ,
    REMOVEFILTER ( Data[user] ) 
)

 

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.