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
CBAEZA
Regular Visitor

Dynamic Column Name depending on Slicer

Good day,

 

I've been working with a Visual that shows Vol with the option of choosing from two separate slicers the periods of time you want to compare.

One takes info from a basic Date table in this format (spans from JAN22 to NOV24):

DATEYEARMONTHMONTH NAME#MONTH#DAY#WEEKWEEKWEEKEND?WEEKDAYQUARTERMW#SEMESTERSortMonthYearM-YSortTrimYearT-YSortSemYearMES ESPAÑOLMES AÑOINDEX
01/10/20242024OCTOCTOBER101240FalseTUESDAY42S2202410OCT-24202404T4-24202402OCT 2024OCT 202457

The second one comes from a summarized version of the first:

MONTHMES ESPAÑOLYEARINDEX
JULJUL 2022202230
AUGAGO 2022202231

The current month is calculated with VOL= SUM('Query O2C'[VOL]) filtered by the first slicer, the previous year with VOL AA = CALCULATE(Measures[VOL], DATEADD(dDate[Date], -12, MONTH)) and VOL M2 with: 

VOL M2 =
VAR IND = SELECTEDVALUE('MONTH 2'[MONTH])
VAR CY = SELECTEDVALUE('MONTH 2'[YEAR])
RETURN
SWITCH(
    IND,
        "ENE", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 1, YEAR(dDate[DATE])= CY),
        "FEB", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 2, YEAR(dDate[DATE]) = CY),
        "MAR", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 3, YEAR(dDate[DATE]) = CY),
        "ABR", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 4, YEAR(dDate[DATE]) = CY),
        "MAY", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 5, YEAR(dDate[DATE]) = CY),
        "JUN", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 6, YEAR(dDate[DATE]) = CY),
        "JUL", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 7, YEAR(dDate[DATE]) = CY),
        "AGO", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 8, YEAR(dDate[DATE]) = CY),
        "SEP", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 9, YEAR(dDate[DATE]) = CY),
        "OCT", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 10, YEAR(dDate[DATE]) = CY),
        "NOV", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 11, YEAR(dDate[DATE]) = CY),
        "DIC", CALCULATE(Measures[VOL],MONTH(dDate[DATE]) = 12, YEAR(dDate[DATE]) = CY)
)
For additional clarity I'd like for the title of the columns in the matrix table to dynamically change depending on the chosen month in both slicers. 

From this:

Slicer 1 linked to dDate[MES ESPAÑOL]: JUN 2024

Slicer 2 linked to MONTH 2[MES ESPAÑOL]: MAY 2022

Visualization:

 VOL AAVOL M2VOL CMDIF VOL AADIF VOL M2
Retail41400004244000423600091000-8000
Wholesale11300001231000115400016000-77000


To this:

 VOL JUN 2023VOL MAY 2022VOL JUNE 2024DIF VOL AADIF VOL M2
Retail4144000424400042360009100)-8000
Wholesale11380001231000115400016000-77000

 

I've tried using these two in Dynamic fields to pull the name: 

  • SELECTEDVALUE
  • IF(ISFILTERED('MONTH 2'[Mes ESPAÑOL]), CONCATENATE("VOL ", (IF(HASONEVALUE('MONTH 2'[Mes ESPAÑOL]),FIRSTNONBLANK('MONTH 2'[Mes ESPAÑOL],"") ,""))), "SELECT A MONTH")

However it has come to my attention that Parameters are incapable of considering the filters despite working perfectly fine as an independent measure. Is there a way to work around this?  

 

Appreciate the help.

4 REPLIES 4
Anonymous
Not applicable

Hi, @CBAEZA 

 

May I ask if your problem is solved? If not resolved, can you provide sample data and your expected output? This will better describe your problem. How to provide sample data in the Power BI Forum - Microsoft Fabric Community

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Excuse me, is there a way to refresh the post or can I post it again with the change for it to be seen properly?

Ritaf1983
Super User
Super User

Hi @CBAEZA 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Fixed the post following your instructions. I'd be happy to add or change anything that I could be missing. Thank you for your help.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors