Forum Discussion
Shree_185
Helper I
4 years agoDAX Calculated Column Help
Hi Everyone, Trying to replicate the below view in one line query (calculated column) Calculate column = Region-wise Distinct Count ID WHERE Date is not blank OR Date is not equal to 01/01/...
- 4 years ago
If you need the visual you posted, it should work. If you need it in a table visual, you need to add an ALLEXCEPT function in the filter expression:
Count ID ALLEXCEPT = CALCULATE ( DISTINCTCOUNT ( 'Table'[ID] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[Region] ), NOT ( ISBLANK ( 'Table'[Date] ) ) && 'Table'[Date] <> DATE ( 2000, 1, 1 ) ) )I've attached the sample PBIX file
PaulDBrown
Community Champion
4 years agoTry:
Count ID =
CALCULATE(DISTINCTCOUNT(Table[ID), FILTER(Table, NOT(ISBLANK(Table[Date])) && Table[Date] <> DATE(2000, 1, 1)))
- Shree_1854 years ago
Helper I
PaulDBrown Thanks for your help. The logic didn't work? or maybe I did some mistake. can you please send me the PBIX file if possible?
- PaulDBrown4 years ago
Community Champion
If you need the visual you posted, it should work. If you need it in a table visual, you need to add an ALLEXCEPT function in the filter expression:
Count ID ALLEXCEPT = CALCULATE ( DISTINCTCOUNT ( 'Table'[ID] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[Region] ), NOT ( ISBLANK ( 'Table'[Date] ) ) && 'Table'[Date] <> DATE ( 2000, 1, 1 ) ) )I've attached the sample PBIX file