Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
yanivsab
Frequent Visitor

Distinct count Active User for 3 last month

Hi 

I Need to create a measure that show the distinct users that didn't made an activity for the last 3 months.

 

Table columns  :

- UserId ( Number )

-TimeFrame ( Date format ) 

- Has Activity (TRUE/FALSE Boolean Column)

 

Below is the measure i build which is not given me the correct picture ( i didn't success to filter the boolean column) 

The measure actually give me the distinct users that didn't made an activity  for each month while i would like to have  the last 3 months without activity.

 

InactiveUser_SPO = CALCULATE(DISTINCTCOUNT(_UserActivity_Export[UserId]),filter(_UserActivity_Export,_UserActivity_Export[TimeFrame].[Month] in {"August","september","october"} ))
 
i will appriciate your help
Thanks in advanced 
Yaniv
1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @yanivsab 
Generally, you can try to check the linked tutorials:

https://www.youtube.com/watch?v=m1uupRDWzQw

https://www.youtube.com/watch?v=cfDyNPQIJtA

 

And the linked discussion:

https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customers-without-purchases-in-gt-6-...

For a more specific solution, please attach the data to work with in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Create a Calendar Table with calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number.  Create a relationship (Many to One) and Single from the Timeframe column of the User Activity Export table to the Date column of the Calendar Table.  To your Table visual, drag User ID.  This DAX measure pattern should work

Measure = countrows(filter(summarize(calculatetable(calendar,datesbetween(calendar[date],edate(eomonth(today()),-4)+1,eomonth(today(),-1))),values(_UserActivity_Export[UserId]),"A",calculate(countrows(_UserActivity_Export),_UserActivity_Export[Has Activity]=true),[A]=0))

Hope this helps.  If it does not, then share the download link of the PBI file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ritaf1983
Super User
Super User

Hi @yanivsab 
Generally, you can try to check the linked tutorials:

https://www.youtube.com/watch?v=m1uupRDWzQw

https://www.youtube.com/watch?v=cfDyNPQIJtA

 

And the linked discussion:

https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customers-without-purchases-in-gt-6-...

For a more specific solution, please attach the data to work with in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Ahmedx
Super User
Super User

Share some data to work with (in a format the can be pasted in an MS Excel file) and show the expected result.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.