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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Ytung
New Member

How to present data based on special calendar

Normally January is Jan 1 -31, February is 2-28......

My company has OWN calendar, in 2020,

January : 2019 Dec 29-2020 Jan 25 (whole 4 weeks)

February : Jan 26 - Feb 29 (whole 5 weeks)

March : Mar 1 - Mar 21 (whole 4 weeks).....

 

What should I do when I choose to present data by year or month (using my company own calendar)? Thank you.

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi  @Ytung 

You could custom a calendar date table by dax to create a new table, but for your description, there are only 4 weeks in one month, now there are 4*7*12=336 days in one year? How to define the remaining days?

 

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Ytung , what you are trying to achieve here. YTD, MTD etc.

Approach will be to make it working using Ranks just like what have been done for Week in this blog -https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@Ytung Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

ryan_mayu
Super User
Super User

@Ytung

 

Please try the coding below to create the datetime table. It only contains the date from 2019/12/29 to 2020/3/21 because you only provide the logic for that period. You can modify the coding.

Dates = 
ADDCOLUMNS (
    CALENDAR (DATE(2019,12,29),DATE(2020,3,21)),
	    "Year", YEAR ( [Date] ),
	    "Monthnum", MONTH ( [Date]),
        "OwnCanlendarMonth", SWITCH(true(),[Date]<=date(2020,1,25),1,[Date]<=date(2020,2,29),2,[Date]<=date(2020,3,21),3)
	   )

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.