locked
Filter out values in graph based on slicer ssdt RRS feed

  • Question

  • I've got a measure that uses the switch function to switch between two other measures for a visual. When one of the values is selected from a slicer I want to remove certain values from a graph I have, but when the other slicer value selected I want to include these values.

    My slicer uses uses the selected measure where it switches between the other two measures.

    ElecPercentOnTime:=

    SUM('Elec Dates'[ElecIsOnTime])/SUM('Elec Dates'[ElecIsClosed])

    ElecPercentOnTime1:=

    SUM('Elec Dates'[ElecIsOnTime])/SUM('Elec Dates'[PASTDUE LATE])

    What I want is for my graph I have in power bi to filter out the OPENPASTDUE(from Elec On Time column) when the first measure is selected but include it when the other measure is selected. Currently the graph uses Elec On Time as the value which is probably the issue. Not sure where to go to solve this issue.

    Wednesday, December 20, 2017 3:50 PM

All replies

  • Hi jshinnenkamp,

    Thanks for your question.

    In this scenario, you can try below code:

    FiltererMeasure: =
    IF (
        HASONEVALUE ( 'Past Dues Late'[CLOSED] )
            && VALUES ( 'Past Dues Late'[CLOSED] ) = "YES",
        [ElecPercentOnTime1],
        [ElecPercentOnTime]
    )


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, December 21, 2017 6:19 AM
  • Thanks for the help.

    I'm a bit confused however on where I'm supposed to implement this measure? Using it in the graph causes it to display only the "ON TIME" values. My goal is to display "ON TIME" and "LATE" at all times and "OPEN PAST DUE" when the slicer has "YES" selected but to filter those out when "NO" is selected

    Thursday, December 21, 2017 1:53 PM
  • Hi jshinnenkamp,

    Thanks for your response.

    I thougt i understand you correctly, but it seems not. According to your last post, I am a bit confused too, your requirement is not clear to me now. Please simply your model and show us what result you are expecting based on those sample data?


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, December 22, 2017 6:51 AM
  • This is the graph I was talking about. The "Graph OPEN PAST DUE as late" slicer is what I need to fix. When "NO" is selected I want the red bars to be filtered out of the graph, but when "YES" is selected I want to include those bars. Currently that slicer affects other visuals in the tab of the report using the formula that is displayed in the above image. I want that to still be the case, but it also is able to filter this graph based on selection.

    Friday, December 22, 2017 2:07 PM
  • Hi jshinnenkamp,

    Thanks for your response.

    >>>Currently that slicer affects other visuals in the tab of the report using the formula that is displayed in the above image. I want that to still be the case, but it also is able to filter this graph based on selection.
    In this scenario, please go to the "Format---Edit interactions" in your Power BI, click on the filter icon in the reports(visuals) you want this slicer to filer to. See below image, product CC will filter all the reports above:


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, December 25, 2017 1:58 AM