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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hbrandol
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.