Forum Discussion

Frunkle93's avatar
Frunkle93
Frequent Visitor
4 years ago
Solved

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.

  • Hi Frunkle93 ,

     

    Try the following code:

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

     

    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

     

     

1 Reply

  • Hi Frunkle93 ,

     

    Try the following code:

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

     

    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