Forum Discussion
Active and Inactive customers
First of all .date is only need when you have a timestamp. Second use a date table. 3 formulas, I am giving. Third one should work
//1
CALCULATE(
DISTINCTCOUNT( TableA[ID] ) ),
DATESINPERIOD( TableA[DATE], MAX( TableA[DATE] ), -6, MONTH )
)
//2
CALCULATE(
DISTINCTCOUNT( TableA[ID] ) ),
DATESINPERIOD( DATE[DATE], MAX( DATE[DATE] ), -6, MONTH )
)
//3
sumx(summarize(calculatetable(TableA,DATESINPERIOD( DATE[DATE], MAX( DATE[DATE] ), -6, MONTH )),
TableA[ID] , "_active",distinctcount(TableA[ID])),_active)
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s.
Refer
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
- manideep5476 years agoHelper III
amitchandak for 3 formula getting error parameter is not the correct type.cannot find the name _active
- amitchandak6 years agoSuper User
missed [ ]
sumx(summarize(calculatetable(TableA,DATESINPERIOD( DATE[DATE], MAX( DATE[DATE] ), -6, MONTH )), TableA[ID] , "_active",distinctcount(TableA[ID])),[_active])- manideep5476 years agoHelper III
amitchandak
can you please check my attachment it getting blank.
https://drive.google.com/open?id=15iTjxrsEJVvzBeczc1d9ByvyNF178ZUi
Here I need the count of active and count of inactive customers based on the date selected in the slicer I need to calculate active users based on a 6month window. It would have to go back 6months from month selected date in a slicer.