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

Join 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.

Reply
ChPetru
Helper I
Helper I

Calculate the revenue only for the last day of the quarter

Hello, I am looking for a way to to calculate the revenue only in the last day of the quarter.

Let's say I am looking (filtering) on Q3FY21, I want the "CustomRevenue" metric to show me the revenue associated to the last day of the fiscal quarter of the particular period.

I have already mapped the fiscal quarter in a separate column, so I need the revenue of the last day of that particular fiscal quarter.

1 ACCEPTED SOLUTION

Actually my formula works! I just have to use it on a measure, not calculated column, since at row level it does not apply on the whole dataset!

 

QEndDatte = calculate(LASTDATE(DateMaster[Master Date]),VALUES(DateMaster[FiscalYearQuarter]))

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

You can use similar logic like this :

last day of quater = 
VAR LastSaleDate =
    CALCULATE (
        MAX ( 'calender table'[Date] ),
        FILTER ( calender table, CALCULATE ( SUM ( 'sales table'[sales] ) ) > 0 )
    )
RETURN
    CALCULATE (sum(
       'sales table'[sales],
        FILTER (
            tbl_Calendar_ph,
            YEAR ( 'calender table'[Date] ) = YEAR ( LastSaleDate )
                && QUATER( LastSaleDate ) = 'calender table'[quater Number]
        )
    )

 

amitchandak
Super User
Super User

@ChPetru , You need a measure like this.

QTD Sales = CALCULATE(lastnonblankvalue('Date'[Date],SUM(Sales[Sales Amount])),DATESQTD(('Date'[Date])))

 

for a selected range, you can avoid datesqtd

 

QTD Sales = CALCULATE(lastnonblankvalue('Date'[Date],SUM(Sales[Sales Amount])))

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

Thank you amitchandak, however DATESQTD uses calendar year quarters. I have a custom fiscal year mapping with first day of the fiscal year starting in 1st of February. I have already calculated the Fiscal Quarter column, just need to find a way to flag the last 'Date'[Date] of the custom fiscal quarters as "True", while every other day that is not an end of quarter to be "False".

 

Or, i have tried this:

QEndDate = calculate(LASTDATE(DateMaster[Master Date]),VALUES(DateMaster[FiscalYearQuarter])), but instead of populating the column with just the last day of each quarter, I simply get the DateMaster[Master Date] values

 

Actually my formula works! I just have to use it on a measure, not calculated column, since at row level it does not apply on the whole dataset!

 

QEndDatte = calculate(LASTDATE(DateMaster[Master Date]),VALUES(DateMaster[FiscalYearQuarter]))

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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