Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
I have a requirement to display the last number of days since the last ticket sold e.g in the below screenshot I want to display 977 for a client.
Here is the DAX to calculate the "Days since the last ticket sold" from the Transaction FACT table.
Solved! Go to Solution.
@Anonymous , Try a new measure like
Days Since Last Ticket Sold =
var _max = MAXX(allselected('Transaction'),'Transaction' [Transaction Date Key])
return
if(MAX('Transaction'[Transaction Date Key]) =_max, DATEDIFF(MAX('Transaction'[Transaction Date Key]),TODAY(),DAY), blank())
@Anonymous , Try a new measure like
Days Since Last Ticket Sold =
var _max = MAXX(allselected('Transaction'),'Transaction' [Transaction Date Key])
return
if(MAX('Transaction'[Transaction Date Key]) =_max, DATEDIFF(MAX('Transaction'[Transaction Date Key]),TODAY(),DAY), blank())
Hi @amitchandak,
I found a problem with the above logic you gave.
This works for 1 Client, but when I have all the clients, it gives results for only those Clients who have the latest/recent Transaction Date.
e.g in the below sample for client "Applause A" Days Since Last Ticket Sold logic should show 520 for Feb-2020
but the logic works for only those clients who have recent transactions (latest date), here it shows 6 days when the latest transaction date was in June 2021 for Client Moon B
Is there a way to correct this and show Days Since the Last Ticket Sold for each client and not only for clients who have the recent/latest transaction date?
Please let me know if you need more information from my end.
User | Count |
---|---|
77 | |
74 | |
63 | |
61 | |
45 |
User | Count |
---|---|
108 | |
102 | |
93 | |
83 | |
64 |