Hello @DaveC,
Thank You for posting your query onto the Forum.
Well, I tried both of the formulas that you’ve provided to achieve the “Most Recent Date For Each Region”. And it’s providing a bit vague results in terms of dates for each region. Below is the screenshot of the result provided for the reference -
As per “As of Date (Old)” measure, it’s providing the date result as “01-12-2021” whereas “As of Date (New)” measure it’s providing all the date results as “01-03-2021” this would have been correct had all the regions had the same date. But for “Region 3” you’ve the end date as “01-02-2021” so not sure how it’s evaulating the correct results in your file. If you select “Region 3” in a slicer than “yes” it does evaluate to correct result. Below is the screenshot of the result provided for the reference -
If you remove the slicer selection than all the results are evaluated to “01-03-2021” which is not appropriate.
Rather than writing long and complicated formulas to achieve the “Most Recent Date For Each Region” you can write one small and short formula as provided below -
As of Date - Harsh =
MAXX( Data , Data[Date] )
Now, in the above screenshot you’ll observe that although I haven’t made any slicer selection the formula is evaluating correct results for the “Region 3” which has end date as “01-02-2021” rather than “01-03-2021”.
Lastly, to calculate the “Total Value” as per “Most Recent Date For Each Region”. You can use the below provided formula -
Total Value of Recent Month =
CALCULATE( SUM( Data[Value] ) ,
FILTER( ALL( Dates ) ,
Dates[Date] = MAXX( Data , Data[Date] ) ) )
And than write the measure to correct the “Grand Total’s” -
Correct Totals =
SUMX(
SUMMARIZE(
Data ,
Data[Region] ,
Data[Metric] ,
"@Totals" ,
[Total Value of Recent Month] ) ,
[@Totals]
)
I’m also attaching the working of the PBIX file for the reference.
Hoping you find this useful and meets your requirements that you’ve been looking for.
Note: To review the measures that I’ve created go to the “Key Measures - Harsh” folder.
Thanks and Warm Regards,
Harsh
Most Recent Date For Each Region - Harsh.pbix (84.2 KB)