Power BI Exchange

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
 View Only
  • 1.  Help on Slicers - to show selected values on Slicer selection

    Bronze Contributor
    Posted Oct 20, 2022 04:20 AM
      |   view attached
    Hello,

    See attached PBI file for your reference.

    I've two different tables. Relationship is created with Date table.

    2 slicers are added, one from Table3 and one from Table4.

    In attached - when I select "BATCHELOR Jeff" from Table 3 Slicer, the chart should only show values from this slicer. But we could see values of Table4 are also getting reflecting in the chart

    For instance we have selected "BATCHELOR Jeff", so the value should only populate 21 of Mar-22 (as we have only 1 record of this customer in Mar-22)

    Similarly if we select Customer Name from Table 4 Slicer, values should reflect of Table 4.

    Any idea. Thanks!

    ------------------------------
    Prem Guru
    ------------------------------

    Attachment(s)

    pbix
    SomeSample.pbix   58 KB 1 version


  • 2.  RE: Help on Slicers - to show selected values on Slicer selection
    Best Answer

    Posted Oct 21, 2022 05:12 AM
      |   view attached
    Hi Prem,

    I added two similar measures:

    Table4 Weight =
    VAR CurCust = SELECTEDVALUE( 'Table3'[Customer Name])
    RETURN
    IF(
        ISFILTERED( 'Table3'[Customer Name]),
        CALCULATE( SUM( 'Table4'[Weight] ),FILTER( 'Table4' ,[Customer Name] = CurCust )),
        SUM( 'Table4'[Weight] )
    )
    Table3 Weight =
    VAR CurCust = SELECTEDVALUE( 'Table4'[Customer Name])
    RETURN
    IF(
        ISFILTERED( 'Table4'[Customer Name]),
        CALCULATE( SUM( 'Table3'[Weight] ),FILTER( 'Table3' ,[Customer Name] = CurCust )),
        SUM( 'Table3'[Weight] )
    )

    And this seems to give you what you want. (attached)

    Hope that helps,





    ------------------------------
    Mark Wiley
    Senior Solutions Architect
    GraVoc
    OH
    ------------------------------

    Attachment(s)

    pbix
    SomeSample.pbix   59 KB 1 version


  • 3.  RE: Help on Slicers - to show selected values on Slicer selection

    Bronze Contributor
    Posted Oct 21, 2022 06:55 AM
    @Mark Wiley,

    ​Thank you for investing your time! I've applied the measure to my sample file and getting the desired result.

    I'm still working on making changes to my actual dashboard and hopefully this gets resolved :)

    Many Thanks! once again.

    ------------------------------
    Prem Guru
    ------------------------------