Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have a report that I'm semi-automating from an excel/powerpoint to a powerBI dashboard. The old SQL required me to change column names every month, but now they are listed as "Month1_Collections" - "Month12_Collections"
This allows me to import the tables more readily into powerBI, but now I am stuck with column headers that don't easily display which month this is in reference to. I don't want to have to individually relabel visualizations as I go. I'm hoping that there is a way to have my columns update during each month's refresh.
Is there a way that I can have the column headers dynamically update each month? For instance, when I load the data in July 2023, the "Month1_Collections" will read as "June2023_Collections" and "Month12_Collections" will read as "July2022_Collections"?
Difficult to know how to approach this without understanding a bit more about the data. However if I were you I'd look at unpivoting the columns (either in SQL, or using Power Query when importing) so that you can get a column with the MonthN_Collections values in them e.g. the black columns below:
Col1 | Col2 | Month_Collection | Value | Month |
X | 1 | Month1_Collection | 100 | Jun-23 |
X | 2 | Month1_Collection | 130 | Jun-23 |
X | 1 | Month2_Collection | 25 | Jul-23 |
X | 2 | Month2_Collection | 500 | Jul-23 |
Y | 1 | Month3_Collection | 45 | Aug-23 |
Once you've got that structure, can you add a column to calculate what the true month header (like the red column)? If so you can do that and then use a Matrix table visual to pivot that back to be the variable column headers you are looking for.
User | Count |
---|---|
103 | |
87 | |
77 | |
70 | |
69 |
User | Count |
---|---|
113 | |
99 | |
97 | |
72 | |
68 |