Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Making a visual that pulls data from two tables

Hi, I want to use a visual to show the projected and actual sales of a product by quarter such as in Table C. My data sources would be Table A and B. I am new to powerBI and would be really grateful ...
  • v-xiaotang's avatar
    4 years ago

    Hi Anonymous 

    Try this, use the first three columns in tableB

    Then create this measure

    Actual =
    CALCULATE (
        COUNTROWS ( 'Table A' ),
        FILTER (
            ALL ( 'Table A' ),
            'Table A'[Product] = MIN ( 'Table B'[Product] )
                && QUARTER ( 'Table A'[Sales Date] )
                    = VALUE ( RIGHT ( MIN ( 'Table B'[Quarter] ), 1 ) )
        )
    )

    Result

     

     

    Best Regards,

    Community Support Team _Tang

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