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

View all the Fabric Data Days sessions on demand. View schedule

Reply
hbrandol
Microsoft Employee
Microsoft Employee

Dynamic Slicers for Bar and Line Chart

I want to create a dynamic slicers for a line and stacked column chart.

 

The line is the ROI values for each product by months and the column is the Total Loan values for each product by months.

ROI is a measure based on sum of interest/sum of total loan; for each product

Total Loan is a measure based on sum of total; for each product

 

My goal is when the user click on the slicer, the column and line related to that product will be chosen.

 

Here what I have done so far:

1. Created the slicer table

Mortgage Loan

Auto Loan

Student Loan

 

2. Created the ROI table

ROIMax
ROI Mortgage Loan1
ROI Auto Loan2
ROI Student Loan3

 

 

3. Created Total Loan Table 

Total LoanMax
Mortgage Loan1
Auto Loan2
Student Loan3

 

4. Created the following measures:

ROI = SWITCH([Max ROI],1,[ROI Mortgage Loan],2,[ROI Auto Loan],3,[ROI Student Loan])

Max ROI = MAX('ROI Table'[Max])

Total Loan = SWITCH([Max Total Loan],1,[Mortgage Loan],2,[Auto Loan],3,[Student Loan])

Max Total Loan = MAX('Total Loan Table'[Max])

 

I cant figure out how to make the slicer works. I cant figure out how the slicer should have both components the ROI and Total Loan.

 

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

Hi,

 

According to your description, i create a table to test:

142.PNG

Then, create two measures:

ROI = SUM('Table'[Interest])/SUM('Table'[Loan values])
Total Loan = SUM('Table'[Loan values])

Choose line and stacked column chart, then set a slicer, and it shows:

141.PNG

143.PNG

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

1 REPLY 1
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, i create a table to test:

142.PNG

Then, create two measures:

ROI = SUM('Table'[Interest])/SUM('Table'[Loan values])
Total Loan = SUM('Table'[Loan values])

Choose line and stacked column chart, then set a slicer, and it shows:

141.PNG

143.PNG

Hope this helps.

 

Best Regards,

Giotto Zhi

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors