Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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!
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
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
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.
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
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"
)
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
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"
)
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
Why This Works
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
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"
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
78 | |
78 | |
57 | |
37 | |
34 |
User | Count |
---|---|
99 | |
56 | |
56 | |
46 | |
40 |