Forum Discussion

ddimitrov's avatar
ddimitrov
Regular Visitor
3 years ago
Solved

How to select data from another table with a single slicer

Hello PowerBI ninjas, gurus, delta forcers.    I am a newcomer to PowerBI and need to design a PowerBI report for our project team.  I tried several approaches to resolve an issue with a slicer fo...
  • v-yanjiang-msft's avatar
    3 years ago

    Hi ddimitrov ,

    According to your description, here's my solution. Create two measures.

    MdaysTarget =
    IF (
        ISFILTERED ( Actuals[Program] ),
        SUMX (
            FILTER (
                ALL ( 'Targets' ),
                'Targets'[Quarter] = SELECTEDVALUE ( Actuals[Quarter] )
                    && 'Targets'[Program] = SELECTEDVALUE ( 'Actuals'[Program] )
            ),
            'Targets'[Mdays]
        ),
        IF (
            ISFILTERED ( 'Actuals'[Quarter] ),
            SUMX (
                FILTER (
                    ALL ( 'Targets' ),
                    'Targets'[Quarter] = SELECTEDVALUE ( Actuals[Quarter] )
                ),
                'Targets'[Mdays]
            ),
            SUM ( 'Targets'[Mdays] )
        )
    )
    
    Difference =
    'Actuals'[MdaysTarget] - SUM ( 'Actuals'[ Mdays] )
    

    Get the result.

    I attach the file below for your reference.

     

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

    Best regards,

    Community Support Team_yanjiang