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
Hayoung
Helper IV
Helper IV

How to create two 100% stacked bar chart with current and last result if filter Name

I would like to show two 100% stacked bar chart with current result and latest last result, and when I filter the name then I can show the two charts automatically. Below is the sample data:

Name Q1_A1Q1_A2Q1_A3Date
A70%20%10%1/9/2022
A50%20%30%5/9/2022
A20%20%60%8/9/2022
A50%40%10%13/9/2022
B30%30%30%2/9/2022
B80%10%10%8/9/2022
A20%20%60%20/9/2022
A50%20% 30%25/9/2022
B30%30%40%12/9/2022
B20%20%60%18/9/2022

 

The expected outcome should be when i filter A in the report view, it return two 100% stacked bar chart, one with 

20%20%60%

 and one with 

50%20% 30%

when i filter B in the report view, it return two 100% stacked bar chart, one with 

30%30%40%

 and one with 

30%30%40%
1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Hayoung,

You can do unpivot column on your 'Quarter' fields to convert them to attribute and value. then use the date on your chart axis and attribute the legends, and value to the value fields.

Unpivot columns (Power Query) (microsoft.com)
After these steps, you need to write a measure filter to check corresponding date ranges and return tags then use it on the chart to filter matched records to cooperate with the Name filter to achieve your requirements.

Applying a measure filter in Power BI - SQLBI

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Hayoung,

You can do unpivot column on your 'Quarter' fields to convert them to attribute and value. then use the date on your chart axis and attribute the legends, and value to the value fields.

Unpivot columns (Power Query) (microsoft.com)
After these steps, you need to write a measure filter to check corresponding date ranges and return tags then use it on the chart to filter matched records to cooperate with the Name filter to achieve your requirements.

Applying a measure filter in Power BI - SQLBI

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
lbendlin
Super User
Super User

Would it be a problem rendering two charts side by side instead?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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