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
MCassady
Helper I
Helper I

Separate Series On Chart With Different Year

I have a table called FactRawData. It is being filtered by the following slicers:

Slicers.png

The following chart, shows the values from factrawdata, for 2018.

chart.png

 

I would like to add a second series on this graph, that is the data from the same table, for the selected year in the "Baseline year" slicer, however I can't seem to get the data to show on the graph. 

 

Below is my custom measure.

baseline cons.png

I have a feeling I need to use ALL, since the slicers forthe first series would be affecting this measure...but I am not sure I am doing it right, since that data does not appear on my graph.

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

Hi @MCassady 

 

Please try to create slicer using two separate tables.

vchenwuzmsft_0-1660900778386.pngvchenwuzmsft_1-1660900792570.png

 

Then create measures for the line chart, one line one measure.

 

year1 =
CALCULATE (
    SUM ( 'Fact Table'[values] ),
    FILTER (
        ALLSELECTED ( 'Fact Table'[Date].[Year] ),
        [Date].[Year] = MAX ( 'Slicer1'[Year] )
    )
)

year2 =
CALCULATE (
    SUM ( 'Fact Table'[values] ),
    FILTER (
        ALLSELECTED ( 'Fact Table'[Date].[Year] ),
        [Date].[Year] = MAX ( 'Slicer2'[Year] )
    )
)

 

 

Result:

vchenwuzmsft_3-1660901062876.gif

 

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @MCassady 

 

Please try to create slicer using two separate tables.

vchenwuzmsft_0-1660900778386.pngvchenwuzmsft_1-1660900792570.png

 

Then create measures for the line chart, one line one measure.

 

year1 =
CALCULATE (
    SUM ( 'Fact Table'[values] ),
    FILTER (
        ALLSELECTED ( 'Fact Table'[Date].[Year] ),
        [Date].[Year] = MAX ( 'Slicer1'[Year] )
    )
)

year2 =
CALCULATE (
    SUM ( 'Fact Table'[values] ),
    FILTER (
        ALLSELECTED ( 'Fact Table'[Date].[Year] ),
        [Date].[Year] = MAX ( 'Slicer2'[Year] )
    )
)

 

 

Result:

vchenwuzmsft_3-1660901062876.gif

 

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

ronaldbalza2023
Continued Contributor
Continued Contributor

Hi @MCassady , hope you are having a great day. Reason is that Power BI is confused on what you are trying to do having those 2 slicers (Year and Baseline Year). My suggestion is to have a month & year column on your date table and place it on your visuals to have the "series" kind of effect. 😉

How to Create a Month Year Column in Calendar 

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.

Top Solution Authors