Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
dandreev
Helper I
Helper I

Finding the latest date in dynamic header

Hi All,
I have a table with date headers like:

December 2021November 2021October 2021September 2021

next month headers will change to:

January 2022December 2021November 2021October 2021

Is there a way like a MAX() function that I call a column based on the latest date in the header?

Thank you!

4 REPLIES 4
CNENFRNL
Community Champion
Community Champion

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.

 

DESCRPTOctober 2021November 2021December 2021
Avalues276319192
Bvalues787345
Cvalues198246147
Dvalues353341218

 

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!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.