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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
RobHel33
Regular Visitor

Date Hierarchy display MoM across calendar years

Hello Gurus,

 

In need of some assistance in displaying months with MoM variance - my months are, July - Dec 2019 and Jan 2020.  With doing this it is now displaying January as the earliest date due to not displaying the year.

 

Any support, greatly appreciated.

 

WIN_20200301_09_53_51_Pro (2).jpg

6 REPLIES 6
amitchandak
Super User
Super User

With a date calendar, you can use these kind formula's to get a variance

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
last year MTD Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))

 

Sort column for the month is

Month Sort = format(Date[date],"YYYYMM")

Sort_by_column.png

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

 

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

Have you tried sorting by month instead of by the variance? Try going to the ellipsis in the visual and sort by month. If that doesn’t work I can share a measure to sort your month if it’s needed.

Thank you for response - did try all sort by options and no luck

 

Appreciate your measure to give that try

Hi @RobHel33 ,

Have you resolved the problem? If yes, please mark the helpful answers as solutions. If not, maybe you could reference the video to have a try.

Sort month name chronologically in Power BI Desktop

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Use the below measure and then sort your month column by that: 

MonthSort = FORMAT('CALENDAR'[Date], "yyyyMM")

@RobHel33 generally with month names you create a "Month Sort" column that is simply MONTH('Table'[Date]). You then click on your Month column and use the Sort By function in the ribbon to sort by your numeric Month Sort column.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors