Forum Discussion

TotunG's avatar
TotunG
Resolver I
3 years ago
Solved

Dynamic Measure to Return Different Values from Table1 related to Table2 by ID

Hello, I have the below table that previously used a Calculated Column (Lookup Value to return a value from another table):   Table1: ID Month Max Value AB123 Jan ERROR (Looku...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi TotunG ,

    Please update the formula of the measure as below and check if it can return your expected result...

    Max Value from Table2 =
    VAR _seldate =
        SELECTEDVALUE ( 'Table2'[Date] )
    VAR _selid1 =
        SELECTEDVALUE ( 'Table1'[ID] )
    RETURN
        CALCULATE (
            MAX ( 'Table2'[Max Value] ),
            FILTER ( 'Table2', 'Table2'[ID] = _selid1 && 'Table2'[Date] = _seldate )
        )

    If the above one can't help you get the expected result, could you please provide more raw datain your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

    And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards