Forum Discussion
Want to create a table which include date wise unique count of users who are completely fresh
- 4 years ago
speedramps Thanks for your time
But we required to create a line chart as per daily fresh inflow of user.Please find attached snap wrt required line chart with automatic uopdate the same unique count day wise.
Table1:
User ID Date A 1/1/2022 B 1/1/2022 C 1/1/2022 D 1/1/2022 B 1/2/2022 D 1/2/2022 E 1/2/2022 D 1/3/2022 F 1/3/2022 G 1/3/2022
Output:
Date Unique Count of user 1/1/2022 4 1/2/2022 1 1/3/2022 2 - Anonymous4 years ago
Hi ddpl ,
Here are the steps you can follow:
1. In Power query. Add Column – Index Column – From 1.
2. Create measure.
Flag = var _1=CALCULATE(MAX('Table'[User ID]),FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])&&'Table'[Date]<=MAX('Table'[Date]))) var _2=CALCULATE(MAX('Table'[User ID]),FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])&&'Table'[Date]=MAX('Table'[Date]))) return CALCULATE(DISTINCTCOUNT('Table'[User ID]), FILTER(ALL('Table'), _2 in SELECTCOLUMNS('Table',"id",_1)&&'Table'[Date]<=MAX('Table'[Date])))Unique Count of user = var _index1=MAXX(FILTER(ALL('Table'),'Table'[Date]=MAX('Table'[Date])),[Flag]) var _index2=MAXX(FILTER(ALL('Table'),'Table'[Date]=MAX('Table'[Date])-1),[Flag]) return _index1 - _index22. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- 4 years ago
Anonymous
Its worked, Thanks a lot for your time
- 4 years ago
Hi Liu
Can I use below dax instead of yours?
Flag New = CALCULATE(DISTINCTCOUNT('Table'[User ID]), FILTER(ALL('Table'),'Table'[DDate]<=MAX('Table'[Date])))Unique Count of USer =var _index1=MAXX(FILTER(ALL('Table'),'Table'[Date]=MAX('Table'[Date])),[Flag New])var _index2=MAXX(FILTER(ALL('Table'),'Table'[Date]=MAX('Table'[Date])-1),[Flag New])return_index1 - _index2This also give me same result.
Hi ddpl ,
Here are the steps you can follow:
1. In Power query. Add Column – Index Column – From 1.
2. Create measure.
Flag =
var _1=CALCULATE(MAX('Table'[User ID]),FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])&&'Table'[Date]<=MAX('Table'[Date])))
var _2=CALCULATE(MAX('Table'[User ID]),FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])&&'Table'[Date]=MAX('Table'[Date])))
return
CALCULATE(DISTINCTCOUNT('Table'[User ID]), FILTER(ALL('Table'), _2 in SELECTCOLUMNS('Table',"id",_1)&&'Table'[Date]<=MAX('Table'[Date])))Unique Count of user =
var _index1=MAXX(FILTER(ALL('Table'),'Table'[Date]=MAX('Table'[Date])),[Flag])
var _index2=MAXX(FILTER(ALL('Table'),'Table'[Date]=MAX('Table'[Date])-1),[Flag])
return
_index1 - _index2
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- ddpl4 years agoSolution Sage
Anonymous
Its worked, Thanks a lot for your time
- ddpl4 years agoSolution Sage
Hi Liu
Can I use below dax instead of yours?
Flag New = CALCULATE(DISTINCTCOUNT('Table'[User ID]), FILTER(ALL('Table'),'Table'[DDate]<=MAX('Table'[Date])))Unique Count of USer =var _index1=MAXX(FILTER(ALL('Table'),'Table'[Date]=MAX('Table'[Date])),[Flag New])var _index2=MAXX(FILTER(ALL('Table'),'Table'[Date]=MAX('Table'[Date])-1),[Flag New])return_index1 - _index2This also give me same result.