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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Parveen_bs_0818
Regular Visitor

Based on slicer selection-> graph should be hidden

I have datetable & customers dataset, both have relationship with date column
i added Year,Quater,Month,Week,Day in slicer
I have added clustered column chart in that x-axis->Year,Quater,Month,Week,Day Y-axis-> count of customers, legend->Location
when user clicks on Year then Quarter related information should be display like Q1,Q2,Q3 etc
when user clicks on Quarter then Month related information should be display like Jan,Feb,Maretc
when user clicks on Month then week related information should be display like W1,W2,W3etc
when user clicks on Week then day related information should be display like 1,2,3etc

i tired many ways output is not coming as expected by client, can anyone help me on this.it would be greatly appreciated.

many tries:
1st try:
i used four graphs and written measures to hide the graphs based on slicer sleection
when i select on year the quarter graph is fetching as per output
when i select on Q1 quarter the month graph is fetching along with Q1 data is fetchning in quarter graph same happening for other selections as well
applied visual level filters.
below is my snapshot attached.

Parveen_bs_0818_0-1737638325277.png

Parveen_bs_0818_1-1737638540326.pngParveen_bs_0818_2-1737638581870.png

2nd Try:
used timeline slicer and added visual level filters when i select on year in x-axis all information is coming along with quarters, months, weeks, days

1 ACCEPTED SOLUTION

All kudos for the solution goes to @v-stephen-msft!

 

@Parveen_bs_0818, take time to learn more about the filed parameters; it's very powerful!

Be creative 🙂 Not always the label should indicate what is happening:

Sergii24_0-1737717139660.png

We keep the same labels but apply different logic behind them! Then, if you want, you can play around with the chart title:

 

Chart Title = 
VAR _SelectedParameterField = SELECTEDVALUE( Parameter[Parameter Fields] )          //get the real name of table and column used in field parameter such as: 'Table'[Quarter]

//getting only word "Quarter"
VAR _OnlyColumnNameStart = FIND("[", _SelectedParameterField )
VAR _OnlyColumnNameEnd = FIND("]", _SelectedParameterField )
VAR _OnlyColumnName = MID( _SelectedParameterField, _OnlyColumnNameStart +1, LEN( _SelectedParameterField ) - _OnlyColumnNameStart - 1 )          //+1 is used to get rid of "[" symbol
//----

RETURN 
    IF(
        CONTAINSSTRING( _OnlyColumnName, "_" ),
        "Sales by Week",
        "Sales by " & _OnlyColumnName
    )

 

 

Here is the final result:

Sergii24_1-1737717242186.png

Good luck with your project!

 

Pbix is attached 🙂

 

 

View solution in original post

6 REPLIES 6
Parveen_bs_0818
Regular Visitor

@Sergii24 , @v-stephen-msft 

Thank you so much for your insightful suggestion regarding field parameters. I truly appreciate the guidance.

I have a follow-up question regarding a specific requirement:
In my current report, we used field parameters to dynamically switch between Year, Quarter, Month, Week, and Day views. While this works well, I have a large dataset, and I’d like to provide users with a more intuitive way to select specific data. Specifically, I’m looking to implement a slicer which i rounded off with blue in snapshot (instead of the parameter dropdown) that allows users to interact with and filter data efficiently.

Is there a recommended approach to achieve this using field parameters or a similar method?



Parveen_bs_0818_0-1737822256741.png

 

Once again, thank you for your support and guidance! Looking forward to hearing your thoughts.


 

Hi @Parveen_bs_0818, create a filed parameter -> place two slicers with it on a canvas -> select the second slicer ->right click on field name in "Field section" ->"Show values of selected field".

 

This will bring you from this:

Sergii24_0-1737900136623.png

 

To this:

Sergii24_1-1737900235674.png

Good luck! 🙂

 

@Sergii24

First, I want to express my sincere thanks for your support so far—it's been incredibly helpful.

I followed the steps we discussed to set up the dynamic graph display in Power BI.
However, I’m encountering an issue:

  • When I select Q1 in the slicer, the graph is showing Q1, but it should display the corresponding month-related information (e.g., Jan, Feb, Mar).
  • Similarly, when I select Jan, the graph is fetching Q1, which indicates that the parent-level filters are being applied instead of showing the expected data for the selected level.

Could you please help me address this issue? I’d really appreciate your guidance to resolve this behavior.

Parveen_bs_0818_0-1737951105014.png

Parveen_bs_0818_1-1737951130937.png

  • When the user selects Quarter, the graph correctly displays the corresponding Month information, which meets my requirement.
  • Similarly, when selecting Year, it displays Quarter, and for Month, it displays Week, and for Week, it displays Day.

While this behavior works perfectly with individual slicers for each level, my requirement is to use a hierarchical slicer instead. Based on the level selected in the hierarchy (Year, Quarter, Month, Week, or Day), the output should dynamically populate the related data at the next level.

Parveen_bs_0818_3-1737951745266.png

 

v-stephen-msft
Community Support
Community Support

Hi @Parveen_bs_0818 ,

 

Thanks for reaching out to us.

Have you tried the field parameters?

Here's the reference.

Use report readers to change visuals (preview) - Power BI | Microsoft Learn

For example, you need to create below year, quarter, month and day columns.

vstephenmsft_0-1737687059159.png

Go to fields parameters, and drag them to create.

vstephenmsft_1-1737687102576.png

vstephenmsft_2-1737687117458.png

Use the Parameter field to create the visual, then you can filter by the parameter.

vstephenmsft_3-1737687183490.png

vstephenmsft_4-1737687222712.png

 

Best Regards,
Stephen Tao

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

@v-stephen-msft 
if i follow the steps you suggested, when user selects year from the slicer the bar chart in  x-axis will display year data, but my requirement is not that..............
my expected output should be like: 

when user selects on Year then Quarter related information should be display like Q1,Q2,Q3 etc
when user selects on Quarter then Month related information should be display like Jan,Feb,Maretc
when user selects on Month then week related information should be display like W1,W2,W3etc
when user selects on Week then day related information should be display like 1,2,3etc

if i add fields to the parameters, then in slicer the text data will populate
i need to show slicer for the user in hierarchy model like below snapshot

Parveen_bs_0818_0-1737691467951.png
if you know can you help me onthis, it would be greatly appreciated.

All kudos for the solution goes to @v-stephen-msft!

 

@Parveen_bs_0818, take time to learn more about the filed parameters; it's very powerful!

Be creative 🙂 Not always the label should indicate what is happening:

Sergii24_0-1737717139660.png

We keep the same labels but apply different logic behind them! Then, if you want, you can play around with the chart title:

 

Chart Title = 
VAR _SelectedParameterField = SELECTEDVALUE( Parameter[Parameter Fields] )          //get the real name of table and column used in field parameter such as: 'Table'[Quarter]

//getting only word "Quarter"
VAR _OnlyColumnNameStart = FIND("[", _SelectedParameterField )
VAR _OnlyColumnNameEnd = FIND("]", _SelectedParameterField )
VAR _OnlyColumnName = MID( _SelectedParameterField, _OnlyColumnNameStart +1, LEN( _SelectedParameterField ) - _OnlyColumnNameStart - 1 )          //+1 is used to get rid of "[" symbol
//----

RETURN 
    IF(
        CONTAINSSTRING( _OnlyColumnName, "_" ),
        "Sales by Week",
        "Sales by " & _OnlyColumnName
    )

 

 

Here is the final result:

Sergii24_1-1737717242186.png

Good luck with your project!

 

Pbix is attached 🙂

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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