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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
KMcCarthy9
Helper V
Helper V

Previous Month Revenue Using Fiscal Year and Fiscal Month

I need to calculate month over month of Revenue Earned but using Fiscal Year and Month. I'm at a complete loss how to do this since the normal date/time intelligence does not work. 

I have a datetable that holds the fiscal information and a table that holds the revenue data. I *simply* just want to show the previous month value and then conditional formatting for an up or down arrow. 

 

I have attached my .pbix here: Revenue 

Thank you in advance! 

1 ACCEPTED SOLUTION

Hi @KMcCarthy9 

 

You can try below measure.

 

xifeng_L_0-1718722236081.png

Previous Month Rev = 
SUMX(
    SUMMARIZE('Datetable','Datetable'[FISCYEAR],'Datetable'[FISCMonthNumber],'Datetable'[FisIndexMonth]),
    VAR CurFISCMonthIndex = 'Datetable'[FisIndexMonth]
    RETURN
    CALCULATE(
        SUM('Revenue'[Revenue Earned]),
        'Datetable'[FisIndexMonth]=CurFISCMonthIndex-1,
        ALL('Datetable')
    )
)

 

 

Demo - Previous Month Rev.pbix

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

 

View solution in original post

4 REPLIES 4
xifeng_L
Super User
Super User

Hi @KMcCarthy9 

 

The file you provided is corrupted, and cannot be opened.

 

xifeng_L_0-1718442892099.png

 

But I think using the DATESADD function should solve your problem?

 

Or you can give the month an index number, such as ( month index = year*12 + month ), and then use the current month index -1 to get the previous month.

 

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

@xifeng_L Apologies for the corrupt file. I believe it is now fixed: Revenue PBI 
I have a fiscal month index column in my datetable. How would I go about using this in my DAX calc? 
I tried the following,which has gotten me the closest, but it doesn't appear to give the previous month, as it's giving the same value. 

 

 

Previous Month Rev = 
var _rev = CALCULATE(SUM('Revenue Breakdown'[Revenue Earned]), 'Revenue Breakdown'[Vendor Type] = "TMO")
RETURN
CALCULATE(
    _rev,
    DATEADD(vw_AMS_DateTable[CALDAY], -1, MONTH),
    ALLEXCEPT(vw_AMS_DateTable, vw_AMS_DateTable[FisIndexMonth]))

 

 

KMcCarthy9_0-1718637379795.png

 

Hi @KMcCarthy9 

 

You can try below measure.

 

xifeng_L_0-1718722236081.png

Previous Month Rev = 
SUMX(
    SUMMARIZE('Datetable','Datetable'[FISCYEAR],'Datetable'[FISCMonthNumber],'Datetable'[FisIndexMonth]),
    VAR CurFISCMonthIndex = 'Datetable'[FisIndexMonth]
    RETURN
    CALCULATE(
        SUM('Revenue'[Revenue Earned]),
        'Datetable'[FisIndexMonth]=CurFISCMonthIndex-1,
        ALL('Datetable')
    )
)

 

 

Demo - Previous Month Rev.pbix

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

 

@xifeng_L  This works! Thank you so much! 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.