Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I have a dax model, where I identify new users marked as "1" in a field.
The new user identification appears only one time to those records which consists new users first time in the model.
e.g. for a given period the data as follows:
User A - 0
User A - 0
User A - 0
User B - 1
User B - 0
User A - 0
User A - 0
User A - 0
User B - 0
User A - 0
User C - 1
User C - 0
In the above data "User A" does not qualify as a new user as he was an old user from previous period. But users "B" & "C" are new users in the given period.
I want to create a measure which calculates "countrows" of new users in the given period.
Expected results:
zero for User A
3 for User B
2 for User C
Any help is appreciated.
Solved! Go to Solution.
Try This:
Measure =
VAR NewUsers = CALCULATETABLE(SELECTCOLUMNS(FactTable,"NewUser",[User_ID]),Filter(FactTable,FactTable[NewField]=1))
RETRUN CALCULATE(COUNTROWS(FactTable),Filter(FactTable,FactTable[User_ID] IN NewUsers))
You can use external filters to select dates / periods and the measure will generate the required results accordingly.
Try This:
Measure =
VAR NewUsers = CALCULATETABLE(SELECTCOLUMNS(FactTable,"NewUser",[User_ID]),Filter(FactTable,FactTable[NewField]=1))
RETRUN CALCULATE(COUNTROWS(FactTable),Filter(FactTable,FactTable[User_ID] IN NewUsers))
You can use external filters to select dates / periods and the measure will generate the required results accordingly.
Hi,
Write this measure
=if(sum(Data[Number])>0,countrows(Data),0)
Hope this helps.
User | Count |
---|---|
98 | |
91 | |
84 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
66 |