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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
brcnyc
Frequent Visitor

I can't filter a calculated field

hataa.JPGHi all,

I've calculated a field and I want to filter this field by gender. I've calculated this field as follows:

 

CALCULATE (

    COUNT ( [Pers.no.] ),

    FILTER ( ALL ( 'UPDATED' ), 'UPDATED'[Data Tarihi] = MAX ( 'UPDATED'[Data Tarihi] ) )

)

 

Shortly, I wanted to see head counts of the most recent date.  And now I want to filter this calculated field by gender. It should look like "pers.no" field which shows men and women's numbers. But as you see it remains the same. What should I do? thank you.

 

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @brcnyc ,

 

If you create a measure, you can replace all with allselected.

CALCULATE (

    COUNT ( [Pers.no.] ),

    FILTER ( ALLSELECTED ( 'UPDATED' ), 'UPDATED'[Data Tarihi] = MAX ( 'UPDATED'[Data Tarihi] ) )

)

 

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

DataZoe
Employee
Employee

@brcnyc I think this may be what you are looking to do:

 

 

CALCULATE (

    COUNT ( [Pers.no.] ),

    FILTER ( ALLEXCEPT ( 'UPDATED','UPDATED'[Cinsiyet] ), 'UPDATED'[Data Tarihi] = MAX ( 'UPDATED'[Data Tarihi] ) )

)

 

 

Using the ALLEXCEPT  https://docs.microsoft.com/en-us/dax/allexcept-function-dax.

 

This should keep the Gender as a filter.

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.