Forum Discussion
lancea
5 years agoHelper I
Dynamic Columns in Data Source
Suppose I have the following data source in Excel: I have a problem retrieving data for the latest month in my visuals, because as the columns are re-arranged depending on which month it...
amitchandak
5 years agoSuper User
lancea , I think you should first unpivot. Split and separate measure and month year (Split on last occurrence of space. an then pivot the measures again.
if need create date using month year
date = "01-" & [Month year] // change data type to date.
Then you find the latest month
max flag =
if([Date] = max([Date]), "Current Month", [Month Year])
You can filter of the current month
refer these if needed
https://radacad.com/pivot-and-unpivot-with-power-bi
https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/
lancea
5 years agoHelper I
Hello, thank you for the info. My question is how do I know which column to unpivot? Since the latest column is always changing. Or do I unpivot all columns starting from the Jan-21?