Forum Discussion
manideep547
Helper III
6 years agosql to dax
select distinctcount(*) from table where Date<' date' andDate>' date 'and customers id in (select Customer Id from table where date<'date' and date>' date ')
Mariusz
Community Champion
6 years agoHi manideep547
Try this.
Measure =
VAR __conditionOne =
CALCULATETABLE(
VALUES( 'Table'[Customer Id] ),
ALL( 'Table'[Date] ),
'Table'[Date] > DATE( 2017, 1, 1 ),
'Table'[Date] < DATE( 2017, 12, 1 )
)
RETURN
CALCULATE(
DISTINCTCOUNT( 'Table'[Customer Id] ),
TREATAS( __conditionOne, 'Table'[Customer Id] ),
ALL( 'Table'[Date] ),
'Table'[Date] > DATE( 2018, 1, 1 ),
'Table'[Date] < DATE( 2019, 1, 1 )
)
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
manideep547
Helper III
6 years agoCorrect me if I'm wrong
I used INTERSECT Dax function with countRows
Mariusz
- Mariusz6 years ago
Community Champion
- manideep5476 years ago
Helper III
Thank you ...!!!
Mariusz