Forum Discussion
Dynamic Measure to Return Different Values from Table1 related to Table2 by ID
- Anonymous3 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
Thank you for your help Anonymous, this does work for MAX/MIN values. What if you were trying to just look up the ACTUAL value of something. Is there a way to replicate LOOKUPVALUE but within a Filter Context e.g. a year slicer affecting LOOKUP value?
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