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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AishwariyaV
Helper IV
Helper IV

Using month name instead of month number

Hi all,

In my report, i have calculated 

Previous month sales = CALCULATE(SUM(Order_Details[Sales]),FILTER(ALL(Order_Details[Month num]),Order_Details[Month num]=MAX(Order_Details[Month num])-1))
Current month sales = CALCULATE(SUM(Order_Details[Sales]),FILTER(ALL(Order_Details[Month num]),Order_Details[Month num]=MAX(Order_Details[Month num]))).
I have included a table visual for these sales.

 

When i am using Month name as slicer and if i select one month name, the previous month sales is not appearing. Only when i select two month names, i am getting the previous month sales. This is one scenario.

 

When i am using Month num as slicer and if i select one month num, i am getting the previous month sales.

 

In my case, i need month name as slicer and if i select one month name, the previous month sales should appear in the table.

 

I couldn't use Month name in the DAX formulamonth1.JPGmonth2.JPGmonth3.JPG

1 ACCEPTED SOLUTION

It doesn't show the previous month because we did not specify the year.

 

Please see attached pbix

 

pbix

View solution in original post

7 REPLIES 7
mussaenda
Super User
Super User

Or you can transform your date in query editor and extract moonth number and month name and use your extracted month num to code and usethe extracted month as slicer.

I have added the Month name and month num by extracting from date. 

 

Using Query Editor? If so, please share a pbix to reproduce the issue

It doesn't show the previous month because we did not specify the year.

 

Please see attached pbix

 

pbix

mussaenda
Super User
Super User

Please share PBIX file. If your data is confidential, pls provide a dummy

Vikram123
Helper I
Helper I

can you share PBIX File

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.