Forum Discussion
Filter two columns lookup
- 8 years ago
Hi dom,
According to your descriptions above, you should be able to use the formulas below to create two measures to calculate target and diff in your scenario. :smileyhappy:
target = CALCULATE ( MAX ( reasons_target[target_time] ), FILTER ( ALL ( reasons_target ), reasons_target[divice_id] = FIRSTNONBLANK ( timeline_stream[line_id], 1 ) && reasons_target[reason_text] = FIRSTNONBLANK ( timeline_stream[reason_text], 1 ) ) )diff = MAX(timeline_stream[setup duration MINS])-[target]
Regards
Hi dom,
According to your descriptions above, you should be able to use the formulas below to create two measures to calculate target and diff in your scenario. :smileyhappy:
target =
CALCULATE (
MAX ( reasons_target[target_time] ),
FILTER (
ALL ( reasons_target ),
reasons_target[divice_id] = FIRSTNONBLANK ( timeline_stream[line_id], 1 )
&& reasons_target[reason_text] = FIRSTNONBLANK ( timeline_stream[reason_text], 1 )
)
)
diff = MAX(timeline_stream[setup duration MINS])-[target]
Regards
- dom8 years agoFrequent Visitor
thank you so much v-ljerr-msft
This is exactly what I was looking for.
Would you mind explaining step by step how it works please
Regards
Dom
- v-ljerr-msft8 years agoMicrosoft Employee
Hi dom,
The formula could be easy to understand if you understand row context and filter context in DAX. The follow articles are for your reference.
https://www.sqlbi.com/articles/filter-arguments-in-calculate/
https://www.sqlbi.com/articles/row-context-and-filter-context-in-dax/
If you have any question, feel free to post back or in new thread. :smileyhappy:
Regards
- dom8 years agoFrequent Visitor
Thanks, i will definately look at it
Regards Dom