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