Forum Discussion
Dax DisctinctCount with date condition
- Anonymous7 years ago
i've tryed both the solutions you guys gave, sadly idk why it didnt work so what i did to make it work is to create a columm in the Sales Tables called "Register Date" with this fucntion
RegisterDate= Related('MembershipTable'[Registerdate]
with this and the a mix of the measure i used at the beginning and parts of yours it worked
Tickets = CALCULATE(DISTINCTCOUNT('SalesTable'[DOC Number]),FILTER('SalesTable','MembershipTable'[RegisterDate]<='SalesTable'[SalesDate]))Thanks a lot for your solutions 3 minds think better than 1 :)
Hi Anonymous ,
Based on having created relationship between this sales table and a membership table which contains the "Register Date", keep Cross filter direction as Both. You may try to create measures like DAX below.
MEASURE = CALCULATE(DISTINCTCOUNT(Table1[DOC Number]),FILTER(ALLSELECTED( Table1), Table1[Sales Date]>=MAX('membership table'[RegisterDate])))
If I misunderstood it, could you please share your sample data or desired output screenshots for further analysis, you can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous7 years agoNot applicable
i've tryed both the solutions you guys gave, sadly idk why it didnt work so what i did to make it work is to create a columm in the Sales Tables called "Register Date" with this fucntion
RegisterDate= Related('MembershipTable'[Registerdate]
with this and the a mix of the measure i used at the beginning and parts of yours it worked
Tickets = CALCULATE(DISTINCTCOUNT('SalesTable'[DOC Number]),FILTER('SalesTable','MembershipTable'[RegisterDate]<='SalesTable'[SalesDate]))Thanks a lot for your solutions 3 minds think better than 1 :)