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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Gertenschere
New Member

connecting two graphs (Bar chart and cluster) with sub categories

Hi! I'm currently trying to create a dashboard with the hours needed to create a product, its main category, sub-category, and the quarter when the product is made. The dataset looks something like this:

 

HoursCategory Level 1Category Level 2Quarter
8AA1Q1
12AA1Q2
25AA1Q3
46AA1Q3
47AA1Q4
48AA2Q1
24AA2Q2
40AA2Q3
12AA2Q4
4AA2Q4
38AA3Q1
6AA3Q3
1AA3Q4
37AA3Q4
34AA3Q4
10AA4Q1
37AA4Q1
43AA4Q2
42AA4Q4
24AA4Q4
49BB1Q1
12BB1Q1
49BB1Q2
33BB1Q3
49BB1Q4
33BB2Q1
22BB2Q1
2BB2Q3
2BB2Q3
47BB2Q4
25BB3Q2
45BB3Q2
50BB3Q3
26BB3Q4
32BB3Q4
37BB4Q1
28BB4Q2
10BB4Q3
34BB4Q4
26BB4Q4

 

The dashboard initially needs to have a cluster chart where you can see the sum of total hours spent on category A and category B products as well as a stacked bar chart with quarters 1 to 4 as the x-axis and hours spent as the y-a xis, category B stacked on category B. Well, that's basic Power BI, so I managed to do it just fine: 

Gertenschere_0-1668026999967.pngGertenschere_2-1668027209465.png

 

 

 

So far so easy, now comes the part where I can't find a solution:

When selecting a category (eg. A) on the cluster chart, I want the bar chart to automatically show the sub-categories of A only.

Now when selecting A, I (obviously) only get this:

Gertenschere_1-1668027097147.png

If I change category 1 with category 2 in the category field in Power BI I initially only get this:

Gertenschere_3-1668027475042.png

After selecting A in the cluster chart I get the result I would have wanted in the beginning:

Gertenschere_4-1668027664567.png

Is there any way to get directly from my first picture to the last one?

Theoretically, the input would probably look like this:

Gertenschere_5-1668027735216.png

Obviously, that's not possible. 

 

Would really appreciate your help!

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Gertenschere ,

You can use new function: Filed Parameter.

You must enable it in Power BI Desktop in Options / Global / Preview Features / Field parameters.

vyangliumsft_0-1668065428516.png

Here are the steps you can follow:

1. Modeliing – New parameter – Fields.

vyangliumsft_1-1668065428521.png

2. Select the field [Category Level1], and enter [Category Level2].

vyangliumsft_2-1668065428525.png

3. Put [Parameter] in Legend.

vyangliumsft_3-1668065428529.png

4. Result:

Parameter select [Category Level1]

vyangliumsft_4-1668065428533.png

Parameter select [Category Level2]

vyangliumsft_5-1668065428540.png

Refer to:

https://www.phdata.io/blog/what-are-field-parameters-in-power-bi/

https://www.youtube.com/watch?v=7QwunJ5l5QQ

 

Best Regards,

Liu Yang

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

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @Gertenschere ,

You can use new function: Filed Parameter.

You must enable it in Power BI Desktop in Options / Global / Preview Features / Field parameters.

vyangliumsft_0-1668065428516.png

Here are the steps you can follow:

1. Modeliing – New parameter – Fields.

vyangliumsft_1-1668065428521.png

2. Select the field [Category Level1], and enter [Category Level2].

vyangliumsft_2-1668065428525.png

3. Put [Parameter] in Legend.

vyangliumsft_3-1668065428529.png

4. Result:

Parameter select [Category Level1]

vyangliumsft_4-1668065428533.png

Parameter select [Category Level2]

vyangliumsft_5-1668065428540.png

Refer to:

https://www.phdata.io/blog/what-are-field-parameters-in-power-bi/

https://www.youtube.com/watch?v=7QwunJ5l5QQ

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.