Forum Discussion
Dax Logic
- Anonymous3 years ago
Hi MohammedGouse,
So you mean want to two step calculation to get the record count that both include current month and previous month?
If that is the case, you can add a variable and replace the raw formula count calculation with VALUES function to extract and store the id list. Then you can extract the previous month id list and use INTERSECT function to compare with above list to get the 'return' count.
INTERSECT function (DAX) - DAX | Microsoft Learn
Regards,
Xiaoxin Sheng
Hi, this is how you calculate generally the number of returning:
Returning Attendees=
CALCULATE( DISTINCTCOUNT('your_table_name'[attendee_id]),
FILTER( ALL('your_table_name'),
CALCULATE( COUNTROWS('your_table_name'),
FILTER( ALL('your_table_name'), 'your_table_name'[attendee_id] = EARLIER('your_table_name'[attendee_id]) ) ) > 1 ) )
Hi Olgad,
Thanks for the Query but actually The Requirement
In Date Slicer i have Selected the Time Period 01/01/2022 to 01/31/2022 and the Count is 31 List of Employees were Snip Added
So Before that date we have 2021 Data As well
Now if select the Date Slicer as above mentioned Date Jan1st to 31st Jan Attedees are 31 , I need to Write a Dax Query any on of this 31 were attended Previous Month
if they have attended those count has comes under Returning. I have Adde the Image Please Review Once
As per Data It Should come under returning as 14 Count .
- Anonymous3 years agoNot applicable
Hi MohammedGouse,
So you mean want to two step calculation to get the record count that both include current month and previous month?
If that is the case, you can add a variable and replace the raw formula count calculation with VALUES function to extract and store the id list. Then you can extract the previous month id list and use INTERSECT function to compare with above list to get the 'return' count.
INTERSECT function (DAX) - DAX | Microsoft Learn
Regards,
Xiaoxin Sheng