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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Swathi1
Helper I
Helper I

To update columns names dynamically in the grid level.

Hello,

 

I need a help regarding, I have table with the following columns,

Region, Territory, CQM1 Month (Jan), CQM2 Month(February), CQM3 Month (March), PQM1 Month(Oct), PQM2 Month (November),PQM3 Month(December).This table contains aggregated data but here I need to diplay dynamically to update month headers in the grid visual. Expected ouput like Region, Territory, Jan, February, March, Oct, November, December as column headers based on the future months.

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Swathi1 the potential solution is to unpivot your table and extract the month, paste the following M query in the advanced editor, and apply the same steps on your data.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WClLSUQoBYkMgNgJiYyA2AWJTIDZTio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Region = _t, Territory = _t, #"CQM1 Month (Jan)" = _t, #"CQM2 Month(February)" = _t, #"CQM3 Month (March)" = _t, #"PQM1 Month(Oct)" = _t, #"PQM2 Month (November)" = _t, #"PQM3 Month(December)" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Region", type text}, {"Territory", type text}, {"CQM1 Month (Jan)", type text}, {"CQM2 Month(February)", type text}, {"CQM3 Month (March)", type text}, {"PQM1 Month(Oct)", type text}, {"PQM2 Month (November)", type text}, {"PQM3 Month(December)", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Region", "Territory"}, "Attribute", "Value"),
    #"Added Custom" = Table.AddColumn(#"Unpivoted Other Columns", "Month", each Text.BetweenDelimiters([Attribute],"(",")"), type text),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Attribute"})
in
    #"Removed Columns"

To visualize, use matrix visual, use month on the columns, and value on the values section of the matrix visual.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

7 REPLIES 7
v-mdharahman
Community Support
Community Support

Hi @Swathi1,

Thanks for reaching out to the Microsoft fabric community forum.

It looks like you want to dynamically update column headers bsaed on the current month. As @parry2k already responded to your query, please go through the response and mark it as solution if your issue is resolved.

 

I would also take a moment to thank @parry2k, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

 

If this post helps then please mark it as a solution, so that other members find it more quickly.

Thank you.

Still I need help on that.

Hi @Swathi1,

Can you please confirm if the original issue is where you are struck or where you able to work on the response provided by @parry2k and got struck somewhere in between.

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

 

 

Hi @Swathi1,

As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.

If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.


If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you for your patience and look forward to hearing from you.

Hi @Swathi1,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.


Thank you.

Hi @Swathi1,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

parry2k
Super User
Super User

@Swathi1 the potential solution is to unpivot your table and extract the month, paste the following M query in the advanced editor, and apply the same steps on your data.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WClLSUQoBYkMgNgJiYyA2AWJTIDZTio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Region = _t, Territory = _t, #"CQM1 Month (Jan)" = _t, #"CQM2 Month(February)" = _t, #"CQM3 Month (March)" = _t, #"PQM1 Month(Oct)" = _t, #"PQM2 Month (November)" = _t, #"PQM3 Month(December)" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Region", type text}, {"Territory", type text}, {"CQM1 Month (Jan)", type text}, {"CQM2 Month(February)", type text}, {"CQM3 Month (March)", type text}, {"PQM1 Month(Oct)", type text}, {"PQM2 Month (November)", type text}, {"PQM3 Month(December)", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Region", "Territory"}, "Attribute", "Value"),
    #"Added Custom" = Table.AddColumn(#"Unpivoted Other Columns", "Month", each Text.BetweenDelimiters([Attribute],"(",")"), type text),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Attribute"})
in
    #"Removed Columns"

To visualize, use matrix visual, use month on the columns, and value on the values section of the matrix visual.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors