Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
PaulCz
New Member

Column with Highest Date in a year

Hi,

which formula do i have to use to calculate the highest date in a year? See Screenhot.

PaulCz_0-1740131469955.png

 

 

1 ACCEPTED SOLUTION

Hi there!

 

if you want to mark the highest date per year in your dataset, showing "True" for the last date of the year and "False" for others, please try this formula:

HighestDateInYear =
VAR MaxDateInYear =
CALCULATE(
MAX('YourTable'[Date]),
ALLEXCEPT('YourTable', 'YourTable'[Year])
)
RETURN
IF('YourTable'[Date] = MaxDateInYear, TRUE(), FALSE())

 

With this formula , MAX('YourTable'[Date]) will get the highest date.
and using ALLEXCEPT('YourTable', 'YourTable'[Year]) will keep the filter only on Year, ignoring other columns.

 

Hope this helps!

😁😁

View solution in original post

3 REPLIES 3
PaulCz
New Member

Thanks so much

Akash_Varuna
Responsive Resident
Responsive Resident

Hi @PaulCz You could achive this with custom column and grouping by year please try this

  • Group by Year:

    • Go to Transform > Group By.
    • Group the data by Year.
    • In the grouped table, create a column called MaxDate that calculates the Maximum Date.
  • Merge Back the Max Date:

    • Expand the grouped table to bring back the MaxDate for each year into the original table.
  • Create the Highest Date Column:

    • Add a Custom Column with the formula:
      if [Date] = [MaxDate] then "True" else "False"
      If this post helped please do give a kudos and accept this as a solution
      Thanks In Advance

Hi there!

 

if you want to mark the highest date per year in your dataset, showing "True" for the last date of the year and "False" for others, please try this formula:

HighestDateInYear =
VAR MaxDateInYear =
CALCULATE(
MAX('YourTable'[Date]),
ALLEXCEPT('YourTable', 'YourTable'[Year])
)
RETURN
IF('YourTable'[Date] = MaxDateInYear, TRUE(), FALSE())

 

With this formula , MAX('YourTable'[Date]) will get the highest date.
and using ALLEXCEPT('YourTable', 'YourTable'[Year]) will keep the filter only on Year, ignoring other columns.

 

Hope this helps!

😁😁

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.