Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 47 | |
| 44 | |
| 20 | |
| 20 |
| User | Count |
|---|---|
| 73 | |
| 72 | |
| 34 | |
| 33 | |
| 31 |