Forum Discussion
dom
8 years agoFrequent Visitor
Filter two columns lookup
Hi. Could someone advise please correct approach to this data model: Both tables are direct query from local sql server. Data are received from production lines A101 and A102. In t...
- 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
v-ljerr-msft
8 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
dom
8 years agoFrequent Visitor
Thanks, i will definately look at it
Regards Dom