I have the below dataset:
I need to calculate the number of accounts grouped by the datedif between today and first date per an account when type = 'cash'.
If I find the min date per account and type 'cash' using
first date =
CALCULATE (
MIN ( tbl[date] ),
ALLEXCEPT ( tbl, tbl[account] ),tbl[type]="cash")
, I get:
And then, applying datedif to find the difference between today() and first date, I get:
The requirement, however, is not to hard-code the type. However, if I use the below formula:
first date =
CALCULATE (
MIN ( tbl[date] ),
ALLEXCEPT ( tbl, tbl[account] ))
and then, 'cash' as a filter, I get the below result which is incorrect:
Hope this helps..
Change [Account] data type to Text.
First Date = CALCULATE(MIN('Table'[Date]), ALLEXCEPT('Table', 'Table'[Account], 'Table'[Type]))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.