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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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