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
wsuphappyhour
Regular Visitor

Independent slicers on each line in line chart

Hi,

 

I need help or answer how to achieve this simple goal:

 

I have 1 simple data table(applies to both line charts)

 

I have 2 line charts and 2 sets of  slicers(same for both charts)

 

Ecah line chart consists of 1 static line (same on both(exact values, column))

 

And one line cotrolled by slicers(same on both(exact values, column))

 

Question:

 

How to merge these line charts to get 2 dynamic lines controled by 2 sets of slicers.

 

Goal: to compare same data set with different selections on 1 chart

 

I am new to PBI i know how to do it with pivot table in excel but not here..

Capture.PNG

 View when slicers applied(goal to get both lines on 1 chart..):

 

Capture1.PNG

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

HI @wsuphappyhour,


If you want line chart shows different values by two slicers, you need to create a new table as source of one slicer. (It is impossible to use same table as source of two slicers to filter on same column)

 

Sample:

2.PNG

 

AVG measure is static value which not effect by slicers.
Red line controlled by table 2 'weekday'; another line controlled by current date column.

 

Formula:

AVG = 
AVERAGEX ( ALL ( 'Table' ), [Amount] )

Dynamic =
CALCULATE (
    SUM ( 'Table'[Amount] ),
    FILTER (
        'Table',
        'Table'[Date]
            IN CALCULATETABLE ( VALUES ( 'Table 2'[Date] ), ALLSELECTED ( 'Table 2' ) )
    )
)

Notice: these tables not have relationship.

 

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 @wsuphappyhour,


If you want line chart shows different values by two slicers, you need to create a new table as source of one slicer. (It is impossible to use same table as source of two slicers to filter on same column)

 

Sample:

2.PNG

 

AVG measure is static value which not effect by slicers.
Red line controlled by table 2 'weekday'; another line controlled by current date column.

 

Formula:

AVG = 
AVERAGEX ( ALL ( 'Table' ), [Amount] )

Dynamic =
CALCULATE (
    SUM ( 'Table'[Amount] ),
    FILTER (
        'Table',
        'Table'[Date]
            IN CALCULATETABLE ( VALUES ( 'Table 2'[Date] ), ALLSELECTED ( 'Table 2' ) )
    )
)

Notice: these tables not have relationship.

 

Regards,

Xiaoxin Sheng

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

Great it works! I thought that I am over complicating things 🙂 Thanks Again

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.