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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
benjaminlperry
Frequent Visitor

Last Date Previous Quarter

So I have a table (KPIs) with completed dates.  I was easily able to get a calculated column for the most recent date......

 

Is_LastDate = IF(KPIs[date_completed] = MAX(KPIs[date_completed]), 1, 0)

 

However, I now want another calculated column that does the same thing, but for the last date in the previous quarter.  It would look like this. 

 

date_completed        Is_LastDatePrevQtr

7/15/2019                              0

6/2/2019                                0

5/15/2019                              0

3/30/2019                              1

2/15/2019                              0

1/13/2019                             0

 

I can't figure out the DAX though.  

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @benjaminlperry ,

I think you can use date function to calculate with date fields to find out specific date who added three months(one quarter) equal to max date.

PrevLastdate =
IF (
    DATE ( YEAR ( 'Table'[Date] ), MONTH ( 'Table'[Date] ) + 3, DAY ( 'Table'[Date] ) )
        = MAX ( 'Table'[Date] ),
    1,
    0
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @benjaminlperry ,

I think you can use date function to calculate with date fields to find out specific date who added three months(one quarter) equal to max date.

PrevLastdate =
IF (
    DATE ( YEAR ( 'Table'[Date] ), MONTH ( 'Table'[Date] ) + 3, DAY ( 'Table'[Date] ) )
        = MAX ( 'Table'[Date] ),
    1,
    0
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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