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
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
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.