Forum Discussion

SBC's avatar
SBC
Icon for Helper III rankHelper III
1 year ago
Solved

Dynamic Column Name in Table Visual Based on Date Slicer Selection

Hi,

I am using a table visual in Power BI, and I want to implement a feature where the column header and data dynamically change based on the user’s selection from a date slicer.

For example:

  1. If the user selects "March" from the slicer, the table should display the month name (e.g., "March") as the column header along with associated data (e.g., "Sales Week1", "Sales Week2", etc.).
  2. The other columns, like "Revenue Generated," should remain static, showing their corresponding values for the selected period.

Sample Table Design:

MarchRevenue Generated
Sales Week110,000
Sales Week215,000
Sales Week312,000
Sales Week411,000

How can I achieve this using DAX or other Power BI functionalities? Any suggestions or guidance would be highly appreciated!

 

Thanks,

SBC

  • SBC 
    The easiest way to achive this kind of scenario is to create a separate measure and use selection of it..
    Below are steps :
    1) Rename the Sales week with space.
    2) Create a basic measure with selected value function.
    3) Drag the measure in card visual and format this...
    4) Group the card visual and Table visual
    Nothing fancy..
    Below screenshots

     

    There could be a way to achive this by adding a disconected table and write a measure top of it.. But it will add an unnecessary a table into your model.
    Let me know which way you want to like.
    Below is the attached pbix file.

     

    Hope it helps

     

    Regards

    sanalytics



     

1 Reply

  • SBC 
    The easiest way to achive this kind of scenario is to create a separate measure and use selection of it..
    Below are steps :
    1) Rename the Sales week with space.
    2) Create a basic measure with selected value function.
    3) Drag the measure in card visual and format this...
    4) Group the card visual and Table visual
    Nothing fancy..
    Below screenshots

     

    There could be a way to achive this by adding a disconected table and write a measure top of it.. But it will add an unnecessary a table into your model.
    Let me know which way you want to like.
    Below is the attached pbix file.

     

    Hope it helps

     

    Regards

    sanalytics