Forum Discussion
Calculate the distinct Count
- 3 years ago
Hi , vinothkumar1990
According to your description, you want to get the distincount of the [State Code] prt [State] .
[1]If you want to create a calcuated column, you can use this dax code:
Column = CALCULATE( DISTINCTCOUNT('Table'[State Code]) ,ALLEXCEPT('Table','Table'[State]) )Column 2 = var _t = CALCULATETABLE( DISTINCT('Table'[State Code]) , ALLEXCEPT('Table','Table'[State])) return CONCATENATEX(_t , [State Code] , ",")The result is as follows:
[2]If you want to create a measre , you can use this dax code and just put the field on the visual:
Measure = var _t = DISTINCT('Table'[State Code]) return CONCATENATEX( _t , [State Code],",")Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , vinothkumar1990
According to your description, you want to get the distincount of the [State Code] prt [State] .
[1]If you want to create a calcuated column, you can use this dax code:
Column = CALCULATE( DISTINCTCOUNT('Table'[State Code]) ,ALLEXCEPT('Table','Table'[State]) )Column 2 = var _t = CALCULATETABLE( DISTINCT('Table'[State Code]) , ALLEXCEPT('Table','Table'[State]))
return
CONCATENATEX(_t , [State Code] , ",")
The result is as follows:
[2]If you want to create a measre , you can use this dax code and just put the field on the visual:
Measure = var _t = DISTINCT('Table'[State Code])
return
CONCATENATEX( _t , [State Code],",")
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly