Forum Discussion
George375
3 years agoRegular Visitor
Create a measure that only filters based on 2 fields
I have a table visual that has 7 columns from various different connected tables in PBI showing order history. I want to create a measure that shows the last time an item on a row was shipped to the ...
bolfri
Solution Sage
3 years agoLast transaction date =
var this_order = 'Sample'[Order Number]
var this_customer = 'Sample'[Customer Number]
return CALCULATE(
MAX('Sample'[Transaction Date]);
'Sample'[Order Number] = this_order;
'Sample'[Customer Number] = this_customer
)
Result:
Is that what you meant?
George375
3 years agoRegular Visitor
I need it to show 01.04.2022 for all as that was the last time it was shipped
- bolfri3 years ago
Solution Sage
Awww I am sorry, I didn't notice that. So you want a MAX(transaction date) for Customer Number?
Max transaction date per customer = var this_customer = [Customer Number] return CALCULATE( MAX([Transaction Date]); FILTER(Tabela;[Customer Number] = this_customer) )- George3753 years agoRegular Visitor
This would work if all the data was from the same table. I have data from different tables that are prelinked. I tried using the related function to bypass this issue but get an error that there is no relationship in the current context.
- bolfri3 years ago
Solution Sage
Sorry, without sample data I can't help you. I don't know your model. I don't know your data. Dummy data with sample rows would help. With screens what you're receving and want you want to get.