Forum Discussion
Anonymous
5 years agoNot applicable
Max Date Count
Hello, I am pretty new to power bi and would like to calculate the sum of the max date in the below table Product Id Date 1 7/21/2021 18:49 2 7/20/2021 18:49 3 7/19/2021 18:49 ...
VahidDM
Super User
5 years agoHi Anonymous ,
First, you need to find the Max, so you can write the below code to find the Max :
VAR _MaxDate = MAX ( 'Product'[Date] )
then use this VAR to calculate the sum of the max date (Count):
then use this VAR to calculate the sum of the max date (Count):
CALCULATE ( COUNTA ( 'Product'[Date] ), 'Product'[Date] = _MaxDate )
So the Measure is as below:
(make sure the table and column names are aligned with your file, then Copy and paste that on your file)
Sum of the Max =
VAR _MaxDate =
MAX ( 'Product'[Date] )
RETURN
CALCULATE ( COUNTA ( 'Product'[Date] ), 'Product'[Date] = _MaxDate )