Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have a table in which I have a date, the associated week and the associated year as three columns. I would like to determine the max date for each week and for each year using PowerBI.
I tried the following code but I am getting the max date across entire column.
Solved! Go to Solution.
Here is a simple version of a calculated column using CALCULATE
Max Date Week =
VAR Y= [Fiscal Year]
VAR W= [Fiscal Week]
RETURN CALCULATE(MAX('Table'[Date]),All('Table'),'Table'[Fiscal Year]=Y,'Table'[Fiscal Week]=W)
If you don't like variables:
If you want to be more sophisticated you can use MAXX:
return maxx(filter('Table','Table'[Fiscal Week]=W && 'Table'[Fiscal Year]=Y),'Table'[Date])
Here is a simple version of a calculated column using CALCULATE
Max Date Week =
VAR Y= [Fiscal Year]
VAR W= [Fiscal Week]
RETURN CALCULATE(MAX('Table'[Date]),All('Table'),'Table'[Fiscal Year]=Y,'Table'[Fiscal Week]=W)
If you don't like variables:
If you want to be more sophisticated you can use MAXX:
return maxx(filter('Table','Table'[Fiscal Week]=W && 'Table'[Fiscal Year]=Y),'Table'[Date])