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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
smithshire
Frequent Visitor

Show Current Month and Previous Month Data

Hi,

 

I have 3 measures as follows:-

 

TotalTraining =CALCULATE (SUM (ADV_NOTE_LINES[AVL_AMOUNT]),
FILTER ( ALL ( ADVICE_NOTES[AVN_TYPE] ), ADVICE_NOTES[AVN_TYPE] = "TRAINING" ))
 
TotCredit =CALCULATE (SUM (HIL[IVL_CHARGE]),
FILTER ( ALL ( HI[IVC_INVOICE_TYPE] ), HI[IVC_INVOICE_TYPE] = "CREDIT" ))
 
TotHire =CALCULATE (SUM (HIL[IVL_CHARGE]),
FILTER ( ALL ( HI[IVC_INVOICE_TYPE] ), HI[IVC_INVOICE_TYPE] <> "CREDIT" ))
 
Which I use to calculate the overall spend of a customer in another measure:-
 
Overall =[TotHire]+[TotalTraining]-[TotCredit]
 
I have a calendar table.
 
I can display the monthly totals for each customer using a month/year date slicer:-
smithshire_1-1653902593086.png

 

How can I also display the the previous month total based on the slicer selection for each customer?

 
1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@smithshire Try this below DAX Measure:

MEASURE = CALCULATE([Overall], DATEADD(TableName[DateColumn],-1,MONTH))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

3 REPLIES 3
smithshire
Frequent Visitor

That worked exactly as I wanted is to, many thanks.

@smithshire You are most welcome! Happy to help you.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Tahreem24
Super User
Super User

@smithshire Try this below DAX Measure:

MEASURE = CALCULATE([Overall], DATEADD(TableName[DateColumn],-1,MONTH))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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