Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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])
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.