Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 customer at that same row but I want it to ignore the other columns in the visual as currently adding a max date measure only shows the date of that row and not the actual latest ship date. Any workarounds?
Last 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?
Proud to be a Super User!
I need it to show 01.04.2022 for all as that was the last time it was shipped
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)
)
Proud to be a Super User!
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.
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.
Proud to be a Super User!
@George375 , Not very clear, see if these can help
Latest
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Here is an example of what my situation is. Basically I have a log of historical data with order #, transaction date, item code and customer number. I want on each line a measure that shows the latest date that item went to that customer. But becuase the order # and date field are in the visual, the measure filters only on those dates when in the table so shows the undesired dates as seen on the example table. Want to know what dax would help me get a table like my goal and not what im currently getting
Goal:
Order Number | Transaction Date | Item Code | Customer Number | Latest Date |
1 | 1/1/2022 | ABC | 123 | 1/4/2022 |
2 | 1/2/2022 | ABC | 123 | 1/4/2022 |
3 | 1/3/2022 | ABC | 123 | 1/4/2022 |
4 | 1/4/2022 | ABC | 123 | 1/4/2022 |
What Im getting on PBI:
Order Number | Transaction Date | Item Code | Customer Number | Latest Date |
1 | 1/1/2022 | ABC | 123 | 1/1/2022 |
2 | 1/2/2022 | ABC | 123 | 1/2/2022 |
3 | 1/3/2022 | ABC | 123 | 1/3/2022 |
4 | 1/4/2022 | ABC | 123 | 1/4/2022 |
User | Count |
---|---|
77 | |
76 | |
44 | |
30 | |
26 |
User | Count |
---|---|
97 | |
91 | |
52 | |
47 | |
46 |