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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Las
Frequent Visitor

Calculation based on latest two dates

Hi Experts,

 

I have a date column which populates based on fortnightly basis ( Fortnightly is 14 days but I receive the data earlier ). My calculation should be based on Max(date) and the previous day that is available. 

 

Example:

Date received
15/04/2022
30/04/2022
12/05/2022

From the above dates, how do i select 30/04/2022 and 12/05/2022 only? and for the next month also the logic should work
the same way like selecting 12/05/2022 and 30/05/2022 (Future date, which is currently not available) automatically.

This might be an easy one but appreciate your help.

 

Thank you.

Las

1 ACCEPTED SOLUTION

@Las , refer

 

amitchandak_0-1651644408730.png

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
Las
Frequent Visitor

Thank you. All good. 

amitchandak
Super User
Super User

@Las , Measures

 

Max date = maxx(allselected(Table), Table[Date])

 

2nd Max date = maxx(filter( allselected(Table), Table[Date] < [Max Date]) , Table[Date])

 

or

 

Max date = maxx(all(Table), Table[Date])

 

2nd Max date = maxx(filter( all(Table), Table[Date] < [Max Date]) , Table[Date])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit

 

Thanks for the prompt response.

2nd Max date, would this pick up 30/04 or 15/04?  Table[Date] < [Max Date] will search for the lowest and compared with the max date?

@Las , refer

 

amitchandak_0-1651644408730.png

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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!

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Kudoed Authors