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

Distinct count based on max date and other criteria

Hello,

 

I need a measure to give me if this site was removed or not. In this case the site is not removed, because in March it´s "N".

But if the Max date is "Y" this should count as 1 removed site.

I have this calculation but it´s wrong.

CALCULATE([Distinct Count HCO MDM ID], FILTER(table,table[SITE_REMOVED_FLG]="Y"))
 

rmeng_1-1617289188157.png

Can you help me it this?

Thanks in advance

 

 

2 REPLIES 2
edhans
Super User
Super User

Try this @rmeng 

edhans_0-1617317153903.png

Site Removed Count = 
CALCULATE(
    DISTINCTCOUNT(Sites[Site ID]),
    Sites[Site Removed] = "Y"
    )


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Sorry for the late reply, the result should be 0 on my table because the result looks at the max date  and if it is Y then the result is 1 if not 0.

The example has the same ID for the 4 rows, you example is correct but you´re comparing different single ID.

Thanks

 

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.

Top Solution Authors