Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
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
I'd like to create something like the below, which shows the % change of something when compared to a single point in time.
I know I can easily show 'month on month' % changes, but I'd like to show how the % changes look every month when that month is compared to a selected month in the past.
I've had to sanitise the data a bit, but here's what I've got - a date table and an events table. Many events happen each day, so I'll need a COUNT for the 'Base Month' then a measure to take each subsequent month and compare to the Base Month to get the % change. I'd like to lines on the chart, one for each 'Event Type'. The X axis will be 'Start of Month', the other axis will be '% Change'.
I'd really like the 'Base Month' to be set by a slicer so the user can update this, but if that's not possible, I'm happy to hard code a date in DAX as plan b.
| [Dates] | [Events] | |||||
| Date | FirstOfMonth | EventID | Date | EventType | ||
| 01/01/2023 | 01/01/2023 | 1 | 01/01/2023 | Minor | ||
| 02/01/2023 | 01/01/2023 | 2 | 01/01/2023 | Major | ||
| 03/01/2023 | 01/01/2023 | 3 | 01/01/2023 | Minor | ||
| 04/01/2023 | 01/01/2023 | 4 | 05/01/2023 | Major | ||
| 05/01/2023 | 01/01/2023 | 5 | 05/01/2023 | Minor | ||
| 06/01/2023 | 01/01/2023 | 6 | 05/01/2023 | Major | ||
| 07/01/2023 | 01/01/2023 | 7 | 05/01/2023 | Major | ||
| 08/01/2023 | 01/01/2023 | 8 | 09/01/2023 | Minor | ||
| 09/01/2023 | 01/01/2023 | 9 | 09/01/2023 | Major | ||
| 10/01/2023 | 01/01/2023 | 10 | 09/01/2023 | Major | ||
| 11/01/2023 | 01/01/2023 | 11 | 12/01/2023 | Minor | ||
| 12/01/2023 | 01/01/2023 | 12 | 12/01/2023 | Minor |
These dates and events continue up to today, I've just truncated the data for this post.
I've spent a day trying to get ChatGPT to help with DAX with no luck, so here's hoping the human commnuity can come to my aid!
Thanks.
Please indicate the expected outcome based on your sample data - or provide more covering sample data.
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.
| User | Count |
|---|---|
| 46 | |
| 43 | |
| 39 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 68 | |
| 31 | |
| 27 | |
| 24 |