Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi All,
I have a table with date headers like:
December 2021 | November 2021 | October 2021 | September 2021 |
next month headers will change to:
January 2022 | December 2021 | November 2021 | October 2021 |
Is there a way like a MAX() function that I call a column based on the latest date in the header?
Thank you!
Unpivot dataset, if possible.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
I did that.I have a viz that require latest month data from a column with date header. I'm curious to see if it is possible to 'query' headers. My background is with another less popular profuct that had the option.
Hi, @dandreev
Not fully sure what you want.
Can you share you sample file for further research?
Best Regards,
Community Support Team _ Eason
I'll try to explain.
DESCRPT | October 2021 | November 2021 | December 2021 |
Avalues | 276 | 319 | 192 |
Bvalues | 78 | 73 | 45 |
Cvalues | 198 | 246 | 147 |
Dvalues | 353 | 341 | 218 |
Headers are set to change every month with Power Query code:
#"Renamed PR_MO_ONE" = Table.RenameColumns(#"Renamed ",{{"PR_MO_ONE", Date.MonthName(Date.AddMonths(DateTime.LocalNow(),-1))&" "& Text.From(Date.Year(Date.AddMonths(DateTime.LocalNow(),-1)))}}),
#"Renamed PR_MO_TWO" = Table.RenameColumns(#"Renamed PR_MO_ONE",{{"PR_MO_TWO", Date.MonthName(Date.AddMonths(DateTime.LocalNow(),-2))&" "& Text.From(Date.Year(Date.AddMonths(DateTime.LocalNow(),-2)))}}),
#"Renamed PR_MO_THREE" = Table.RenameColumns(#"Renamed PR_MO_TWO",{{"PR_MO_THREE", Date.MonthName(Date.AddMonths(DateTime.LocalNow(),-3))&" "& Text.From(Date.Year(Date.AddMonths(DateTime.LocalNow(),-3)))}})
Let's say I have a barchart that should show values for last month and a line chart that excludes latest month based on headers.
If it is too confusing I'll just close the request.
Thank you!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
80 | |
53 | |
39 | |
39 |
User | Count |
---|---|
104 | |
85 | |
47 | |
44 | |
43 |