Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi,
I am using the DAX calendar function as below:
CALENDAR ( DATE ( 2019, 1, 1 ), DATE ( 2019, 12, 31 ) )
and this is working exactly as hoped as I can use it to total my data into months for the year.
However I have records that are pre 01/01/2019 and I want to show them as pre the calendar start date so I would have something like below:
Is there any additonal code i can add to my calendar to group anything pre 2019?
Any advice appreciated
Solved! Go to Solution.
@Anonymous you need to add following columns in your date table
Month = IF( YEAR( Calendar[Date] ) < 2019, "Pre 2019", FORMAT( Calendar[Date], "MMM-YY" ) )
add another column to sort the month
Month Sort = IF( YEAR( Calendar[Date] ) < 2019, "2019-00", FORMAT( Calendar[Date], "YYYY-MM" ) )
Select Month column and goto modelling tab, select sort by column and choose Month Sort
Now on matrix visual, put Month column and your value column on values and you will achieve the result.
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.
@Anonymous you need to add following columns in your date table
Month = IF( YEAR( Calendar[Date] ) < 2019, "Pre 2019", FORMAT( Calendar[Date], "MMM-YY" ) )
add another column to sort the month
Month Sort = IF( YEAR( Calendar[Date] ) < 2019, "2019-00", FORMAT( Calendar[Date], "YYYY-MM" ) )
Select Month column and goto modelling tab, select sort by column and choose Month Sort
Now on matrix visual, put Month column and your value column on values and you will achieve the result.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
78 | |
65 | |
52 | |
30 |
User | Count |
---|---|
115 | |
114 | |
71 | |
66 | |
39 |