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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Sibrulotte
Helper IV
Helper IV

Remove filter nor removing filters

Hi, 

I've joing a basic model that ressembles something that work great for a topic we have. 

 

I'd like to show the number of customers that were present on may 31st of the previous fiscal year of the selection done. For exemple, in the file, fiscal year 2025 is selected, and I should see 6 customers in my measure:

 

NB_epargnant_31_mai_comp =
var vdern_date_31_mai_prec = date(max(Calendrier[Fiscal year]), 05,31)-365
var vfiltre_31mai = filter(Soldes, Soldes[Date_solde] = vdern_date_31_mai_prec)
var result = calculate(distinctcount(Soldes[Epargnant_ID]), removefilters(Calendrier) , vfiltre_31mai)
return
result
 
Unfortunatly, the measure returns nothing as it's filtering for 2025 results.
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Sibrulotte ,

 

I update the measure and you can try this.

NB_epargnant_31_mai_comp =
VAR vdern_date_31_mai_prec =
    DATE ( MAX ( Calendrier[Fiscal year] ), 05, 31 ) - 365
VAR result =
    CALCULATE (
        DISTINCTCOUNT ( Soldes[Epargnant_ID] ),
        FILTER (
            ALLEXCEPT ( Soldes, Comptes_epargnants, 'Régimes' ),
            Soldes[Date_solde] = vdern_date_31_mai_prec
        )
    )
RETURN
    result

Result is as below.

vrzhoumsft_0-1729822909635.png

 

Best Regards,
Rico Zhou

 

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

5 REPLIES 5
lbendlin
Super User
Super User

the number of customers that were present on may 31st of the previous fiscal year of 

what does "present"  mean?  They had saldos?

 

lbendlin_0-1729635753779.png

 

lbendlin_1-1729635837220.png

 

Wow, you really did me dirty exposing my fake client names lol.

Yes, it's a count of Epargnant_ID. and Epargnant can have multiple accounts, but even if this model doesn't represent that reality, yes it's still a distinct customer count.

Anonymous
Not applicable

Hi @Sibrulotte ,

 

Please refer to below code.

NB_epargnant_31_mai_comp = 
var vdern_date_31_mai_prec = date(max(Calendrier[Fiscal year]), 05,31)-365
var result = calculate(distinctcount(Soldes[Epargnant_ID]), FILTER(ALL(Soldes),Soldes[Date_solde] = vdern_date_31_mai_prec))
var result1 = calculate(distinctcount(Soldes[Epargnant_ID]), REMOVEFILTERS(Soldes),Soldes[Date_solde] = vdern_date_31_mai_prec)
return
result1

If you want to use REMOVEFILTERS() you can try result1. You can also try ALL() function like result, the result is the same.

vrzhoumsft_0-1729763301182.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi Zhou, thank you for the response. The result works partially since the measure does not provide a ventilated result when using in a matrix with a reference table like "Régime" in this file. All values of régime come out with 6, but I was expecting 3 and 3.

Anonymous
Not applicable

Hi @Sibrulotte ,

 

I update the measure and you can try this.

NB_epargnant_31_mai_comp =
VAR vdern_date_31_mai_prec =
    DATE ( MAX ( Calendrier[Fiscal year] ), 05, 31 ) - 365
VAR result =
    CALCULATE (
        DISTINCTCOUNT ( Soldes[Epargnant_ID] ),
        FILTER (
            ALLEXCEPT ( Soldes, Comptes_epargnants, 'Régimes' ),
            Soldes[Date_solde] = vdern_date_31_mai_prec
        )
    )
RETURN
    result

Result is as below.

vrzhoumsft_0-1729822909635.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors