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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
AniGaikwad
Regular Visitor

Dynamic Chart Title Based on Fiscal Hierarchy Level in Stacked Column Chart

I am using a stacked column chart in Power BI where the X-axis contains a fiscal hierarchy with three levels: Fiscal Year, Fiscal Quarter, and Fiscal Month. This hierarchy is text-based.

 

In the Y-axis, I am using a DAX measure for Customer Count. I want to create a dynamic chart title that reflects the hierarchy level currently in view, such as:

• “# Customers by Fiscal Year”

• “# Customers by Fiscal Quarter”

• “# Customers by Fiscal Month”

 

I do not want to rename the DAX measure to “# Customers”.

 

I have already tried using the ISINSCOPE, HASONEVALUE, and ISFILTERED functions, but I am still unable to achieve the desired result. The title either remains static or does not correctly reflect the hierarchy level.

 

Has anyone encountered a similar issue or found a reliable way to dynamically update the chart title based on the visible hierarchy level?

 

Thanks in advance for your help!

15 REPLIES 15
v-vpabbu
Community Support
Community Support

Hi @AniGaikwad,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Regards,
Vinay Pabbu

Hi @AniGaikwad,


I just wanted to follow up on your thread. If the issue is resolved, it would be great if you could mark the solution so other community members facing similar issues can benefit too.
If not, don’t hesitate to reach out, we’re happy to keep working with you on this.

 

Regards,

Vinay Pabbu

Hello @AniGaikwad,
Just wanted to drop a quick note, were you able to resolve the issue you raised?
If so, it would be really helpful for the community if you could mark the answer that helped you the most. If you're still looking for guidance, feel free to give us an update, we’re here for you!

 

Regards,

Vinay Pabbu

AniGaikwad
Regular Visitor

I have tried this , still getting only '# Customers' in every hierarchy level

SWITCH(

    TRUE(),
ISINSCOPE('Date'[Week]), "# Customers by Week",

    ISINSCOPE('Date'[Fiscal Month]), "# Customers by Fiscal Month",

    ISINSCOPE('Date'[Fiscal Quarter]), "# Customers by Fiscal Quarter",

    ISINSCOPE('Date'[Fiscal Year]), "# Customers by Fiscal Year",

    "# Customers"

)

danextian
Super User
Super User

Hi @AniGaikwad

When expanding the hierarchy, none of the approaches provided earlier will work because the title has no row context and cannot determine if a lower hierarchy level is expanded or not. In a drill-down scenario, a conditional measure that checks whether a lower-level hierarchy is in scope should be used. This condition must start by evaluating the lowest hierarchy level first.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

I have tried this , still getting only '# Customers' in every hierarchy level

SWITCH(

    TRUE(),
ISINSCOPE('Date'[Week]), "# Customers by Week",

    ISINSCOPE('Date'[Fiscal Month]), "# Customers by Fiscal Month",

    ISINSCOPE('Date'[Fiscal Quarter]), "# Customers by Fiscal Quarter",

    ISINSCOPE('Date'[Fiscal Year]), "# Customers by Fiscal Year",

    "# Customers"

)

Hi @AniGaikwad,

 

Please ensure that you're using a proper hierarchy field in the X-axis (created in the Fields pane) rather than adding separate fields manually. Dynamic titles using ISINSCOPE only work correctly when a true hierarchy is used in the visual.

 

Regards,

Vinay Pabbu

pankajnamekar25
Memorable Member
Memorable Member

Hello @AniGaikwad 

 

Try this measure

Dynamic Chart Title =

SWITCH(

    TRUE(),

    ISINSCOPE('Date'[Fiscal Month]), "# Customers by Fiscal Month",

    ISINSCOPE('Date'[Fiscal Quarter]), "# Customers by Fiscal Quarter",

    ISINSCOPE('Date'[Fiscal Year]), "# Customers by Fiscal Year",

    "# Customers"

)

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

I have tried this , still getting only '# Customers' in every hierarchy level

SWITCH(

    TRUE(),
ISINSCOPE('Date'[Week]), "# Customers by Week",

    ISINSCOPE('Date'[Fiscal Month]), "# Customers by Fiscal Month",

    ISINSCOPE('Date'[Fiscal Quarter]), "# Customers by Fiscal Quarter",

    ISINSCOPE('Date'[Fiscal Year]), "# Customers by Fiscal Year",

    "# Customers"

)

maruthisp
Solution Specialist
Solution Specialist

Hi AniGaikwad


As per Nasif_Azam and MayflyAnalytics , SWITCH and ISINSCOPE helps to achieve what youa re looking for.

Dynamic Chart Title =
SWITCH(
TRUE(),
ISINSCOPE('Date'[Fiscal Month]), "# Customers by Fiscal Month",
ISINSCOPE('Date'[Fiscal Quarter]), "# Customers by Fiscal Quarter",
ISINSCOPE('Date'[Fiscal Year]), "# Customers by Fiscal Year",
"# Customers"
)

1.ISINSCOPE() checks if a specific column is currently being used in the visual’s axis.
2.The order matters: it checks from most granular (Month) to least (Year).
3.SWITCH(TRUE(), ...) is a clean way to evaluate multiple conditions.

4.Please let me know if you have further questions.

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X

I have tried this , still getting only '# Customers' in every hierarchy level

SWITCH(

    TRUE(),
ISINSCOPE('Date'[Week]), "# Customers by Week",

    ISINSCOPE('Date'[Fiscal Month]), "# Customers by Fiscal Month",

    ISINSCOPE('Date'[Fiscal Quarter]), "# Customers by Fiscal Quarter",

    ISINSCOPE('Date'[Fiscal Year]), "# Customers by Fiscal Year",

    "# Customers"

)

I have tried this , still getting only '# Customers' in every hierarchy level

SWITCH(

    TRUE(),
ISINSCOPE('Date'[Week]), "# Customers by Week",

    ISINSCOPE('Date'[Fiscal Month]), "# Customers by Fiscal Month",

    ISINSCOPE('Date'[Fiscal Quarter]), "# Customers by Fiscal Quarter",

    ISINSCOPE('Date'[Fiscal Year]), "# Customers by Fiscal Year",

    "# Customers"

)

Nasif_Azam
Solution Sage
Solution Sage

Hey @AniGaikwad ,

Yes, you can create a dynamic chart title based on the currently visible level of a fiscal hierarchy (Fiscal Year, Fiscal Quarter, Fiscal Month) in a stacked column chart using DAX in Power BI. Since you’re working with a text-based hierarchy and have tried common functions like ISINSCOPE, HASONEVALUE, and ISFILTERED, here’s a refined solution tailored for your scenario.

 

Solution

1. Understand ISINSCOPE for Hierarchies

The ISINSCOPE() function works best for identifying the deepest level visible in a hierarchy. You need to check the levels from deepest (Fiscal Month) to highest (Fiscal Year) in reverse order because Power BI evaluates all visible levels.

 

2. Create the Dynamic Title Measure

Chart Title = 

SWITCH(

    TRUE(),

    ISINSCOPE('Date'[Fiscal Month]), "# Customers by Fiscal Month",

    ISINSCOPE('Date'[Fiscal Quarter]), "# Customers by Fiscal Quarter",

    ISINSCOPE('Date'[Fiscal Year]), "# Customers by Fiscal Year",

    "# Customers"

)

Replace 'Date' with the name of your date table and ensure [Fiscal Month], [Fiscal Quarter], and [Fiscal Year] are the exact column names used in your hierarchy.

 

3. Use the Title in the Chart

  • Select the stacked column chart.
  • Go to the Format pane → Title → Turn it On.
  • In the fx button (conditional formatting), bind the title to the Chart Title measure.

 

Why This Works

  • ISINSCOPE('Date'[Fiscal Month]) returns TRUE only when that level is active (i.e., visible as the granularity on the X-axis).
  • The order of conditions matters: check Month → Quarter → Year, as multiple levels may be in scope simultaneously depending on drill behavior.

If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.


Best Regards,
Nasif Azam

MayflyAnalytics
New Member

Have you tried using ISINSCOPE in conjuction with SWITCH?  See below:

 

Dynamic Title = 
SWITCH(
    TRUE(),
    ISINSCOPE('Calendar'[FiscalMonth]), "# Customers by Fiscal Month",
    ISINSCOPE('Calendar'[FiscalQuarter]), "# Customers by Fiscal Quarter",
    ISINSCOPE('Calendar'[FiscalYear]), "# Customers by Fiscal Year",
    "# Customers"
)

I have tried this , still getting only '# Customers' in every hierarchy level

SWITCH(

    TRUE(),
ISINSCOPE('Date'[Week]), "# Customers by Week",

    ISINSCOPE('Date'[Fiscal Month]), "# Customers by Fiscal Month",

    ISINSCOPE('Date'[Fiscal Quarter]), "# Customers by Fiscal Quarter",

    ISINSCOPE('Date'[Fiscal Year]), "# Customers by Fiscal Year",

    "# Customers"

)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.