Forum Discussion
madzgalj_darko
3 years agoFrequent Visitor
First transaction for each user for each day
Hello everyone, I was searching all around for DAX for my situation. Hope someone here can help me So basically i have a table with thousands transactions per day, I need a DAX that is gonna give m...
- 3 years ago
Supposing you have a table like:
user_id amount created_at A 1 5/4/2023 10:01 A 2 5/4/2023 10:02 A 3 5/4/2023 10:03 B 11 5/4/2023 10:01 B 22 5/4/2023 10:02 B 33 5/4/2023 10:03 try like:
1)add a calculated column like:date = DATEVALUE([created_at])2)plot a table visual with user_id and date columns with a measure like:
DailyFirstAmt = MINX( TOPN( 1, data, data[created_at], 1 ), data[amount] )it worked like:
FreemanZ
Super User
3 years agoSupposing you have a table like:
| user_id | amount | created_at |
| A | 1 | 5/4/2023 10:01 |
| A | 2 | 5/4/2023 10:02 |
| A | 3 | 5/4/2023 10:03 |
| B | 11 | 5/4/2023 10:01 |
| B | 22 | 5/4/2023 10:02 |
| B | 33 | 5/4/2023 10:03 |
try like:
1)add a calculated column like:
date = DATEVALUE([created_at])
2)plot a table visual with user_id and date columns with a measure like:
DailyFirstAmt =
MINX(
TOPN(
1,
data,
data[created_at],
1
),
data[amount]
)
it worked like:
madzgalj_darko
3 years agoFrequent Visitor
Perfect FreemanZ,
This is exactly what i was looking for! You really helped!
Thank you, all the best!