Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Slicer

Hi,

 

I am new to Power Bi.  I have multiple lines on a line chart and a slicer to pick each line. When I select one of the lines in the slicer it gives me 1 dot instead of the line I am looking for. 

 

Any help is appreciated.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    You can try something like the following code to achieve this effect. 

    MEASURE =
    IF (
        ISFILTERED ( 'DataTable'[LineItem] ),
        IF (
            MAX ( 'DataTable'[Date] ) = DATE ( 2024, 01, 01 ),
            SUM ( 'DataTable'[Value] ),
            BLANK ()
        ),
        SUM ( 'DataTable'[Value] )
    )
    

    If the problem persists, please provide a screenshot and describe it.

     

    Best Regards,
    Adamk Kong

     

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

3 Replies

  • ajohnso2's avatar
    ajohnso2
    Solution Supplier

    Need more info, I am not sure of your model but it sounds like all your data maybe in one table? Your slicer selection is likely filtering to only return 1 data point.

  • ExcelMonke's avatar
    ExcelMonke
    Impactful Individual

    Hello, 

    Seeing a single dot instead of a line could be due to the slicer selection filtering out your x-axis values. Please add some screenshots with your current result and intended result for the forum to better understand your problem and potential solutions.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You can try something like the following code to achieve this effect. 

    MEASURE =
    IF (
        ISFILTERED ( 'DataTable'[LineItem] ),
        IF (
            MAX ( 'DataTable'[Date] ) = DATE ( 2024, 01, 01 ),
            SUM ( 'DataTable'[Value] ),
            BLANK ()
        ),
        SUM ( 'DataTable'[Value] )
    )
    

    If the problem persists, please provide a screenshot and describe it.

     

    Best Regards,
    Adamk Kong

     

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