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
Reddypk
Frequent Visitor

distinct count ignoring all filters applied

Hi I have 2 datasets 

1. Excel: this has specific list of sponsor names and specific time frame with their work status

2. Excel: all sponsors + all works they have done 

 

Work: step 1 - I filtered for work in progress in excel 1 and filtered out all sponsor names whose work status is work in progress 

           Step 2 - for the above list of sponsors (from step one), i need total number of works done irrespective of filters and this is coming from Excel sheet 2 

 

Issue: when i plot a table, BI is going back and getting only data for specific dates mentioned in excel 1 but i need all works done by him from excel 2

1 REPLY 1
v-cgao-msft
Community Support
Community Support

Hi @Reddypk ,

 

Please try like:

distinct count =
VAR _sponsor =
    MAX ( 'Table1'[sponsor names] )
VAR _distcount =
    CALCULATE (
        DISTINCTCOUNT ( 'Table2'[works] ),
        FILTER ( ALL ( 'Table2' ), 'Table2'[sponsor names] = _sponsor )
    )
RETURN
    _distcount

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

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.