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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Frunkle93
Frequent Visitor

How to only count values in one column with condition max value in another column?

Hello,

 

I would only like the value in 'Beoordeling' to be counted when 'Startdatum' is Max. 

'Gevolmachtigde', 'Combitaak' and 'Jaar' should be unique.

So in this example, only the bold values should be counted.

If 'Gevolmachtigde', 'Combitaak' or 'Jaar' changes, again the Max value of 'Startdatum' should be calculated and the value of 'Beoordeling' should be counted.

 

GevolmachtigdeCombitaakJaar StartdatumBeoordeling
AACC-620201-3-2020Goed
AACC-620201-6-2020Goed
AACC-620201-9-2020Goed
AACC-620201-12-2020Goed
BACC-620201-3-2020Goed
BACC-620201-6-2020Goed
BACC-620201-9-2020Goed
BACC-620201-12-2020Goed

 

 

Hope this is clear. Thanks in advance.

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Frunkle93 ,

 

Try the following code:

Calculate = 
Var MaximumDate = MAX('Table'[Startdatum])

Return
CALCULATE( COUNT('Table'[Beoordeling]),'Table'[Startdatum] = MaximumDate)

 

MFelix_0-1651855403232.png

Based on your data the information is very reduced but has you can see I have made a change to the dataset and included a new line for B on the maximum date has you can see the result is updating

MFelix_1-1651855491779.pngMFelix_2-1651855500217.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Frunkle93 ,

 

Try the following code:

Calculate = 
Var MaximumDate = MAX('Table'[Startdatum])

Return
CALCULATE( COUNT('Table'[Beoordeling]),'Table'[Startdatum] = MaximumDate)

 

MFelix_0-1651855403232.png

Based on your data the information is very reduced but has you can see I have made a change to the dataset and included a new line for B on the maximum date has you can see the result is updating

MFelix_1-1651855491779.pngMFelix_2-1651855500217.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.