Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi ,im trying to create a measure that calculate and visualize the number of activities(eg: creating policies) performed by user in last 3 months( month by month) and also in a same or another visual to show total count of last 3 months when username is selected.
Date | Activity | username |
1/5/2022 | policy creation | DD |
21/5/2022 | policy creation | AA |
29/5/2022 | policy creation | AA |
6/6/2022 | policy creation | DD |
15/06/2022 | policy creation | DD |
28/6/2022 | policy creation | BB |
1/7/2022 | policy creation | CC |
10/7/2022 | policy creation | AA |
20/07/2022 | policy creation | JJ |
Output:
Date | Username | count of activity |
May-2022 | DD | 1 |
May-2022 | AA | 2 |
Jun-2022 | DD | 2 |
Jun-2022 | BB | 1 |
Jul-2022 | CC | 1 |
Jul-2022 | AA | 1 |
Jul-2022 | JJ | 1 |
Total | 9 |
Solved! Go to Solution.
Hi @Anonymous ,
Is your data coming from the same table? In my example data the measure returns the correct result.
Measure =
VAR currentmonth =
EOMONTH ( MAXX ( ALLSELECTED ( 'Table' ), 'Table'[Date] ), 0 )
RETURN
CALCULATE (
COUNT ( 'Table'[Activity] ),
FILTER (
'Table',
'Table'[Date] > EDATE ( currentmonth, -3 )
&& 'Table'[Date] <= currentmonth
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Has your problem been solved? If it is solved, please mark a reply which is helpful to you.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
Hi @Anonymous ,
Is your data coming from the same table? In my example data the measure returns the correct result.
Measure =
VAR currentmonth =
EOMONTH ( MAXX ( ALLSELECTED ( 'Table' ), 'Table'[Date] ), 0 )
RETURN
CALCULATE (
COUNT ( 'Table'[Activity] ),
FILTER (
'Table',
'Table'[Date] > EDATE ( currentmonth, -3 )
&& 'Table'[Date] <= currentmonth
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@amitchandak - This calculates and provides the total count but not the count of activites of users performed in the specific month (third column).
any help is appreciated .
p.s. basically on the x axis the user names to be displayed and on yaxis the count of activities that they have done in the individual months
@Anonymous , Create a measure like this and use in visual
Last 3 Months Today =
var _min = eomonth(today(),-3)+1
var _max = eomonth(today(),0)
return
CALCULATE(countrows(Table) , FILTER('Table','Table'[Date] >=_min && 'Table'[Date] <= _max))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |