Forum Discussion
Distinct Count based on Multiple Conditions
Hello I am trying to achieve a distinct count of Document # based on the column "Location Code". In this example the count should equal to 8. I am doing a distinct ct by the invoice number and the results are 1 but I can't figure out how to get it to calculate correctly.
Hi KatchB ,
According to your description, you want to get the distinct count of location code, you can directly create a measure:
Measure = DISTINCTCOUNT([Location Code])If you have more than one value in the Document No column, and you want to get the distinct count of Location Code by each Document No. Directly put Document No and Location Code in a visual and select "Count(Distinct)" of the Location Code column.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- JoeBarrySolution Sage
Hi KatchB
I will presume you want to dispay this number in a Table Visual?
we you're on the right track with your measure.
TotalDocNo= DISTINCTCOUNT(Table[Document No])Then in the Table add the Location Code first and then the new measure, then you will get the result you want
Thanks
Joe
If this post helps, then please Accept it as the solution
- v-yanjiang-msftCommunity Support
Hi KatchB ,
According to your description, you want to get the distinct count of location code, you can directly create a measure:
Measure = DISTINCTCOUNT([Location Code])If you have more than one value in the Document No column, and you want to get the distinct count of Location Code by each Document No. Directly put Document No and Location Code in a visual and select "Count(Distinct)" of the Location Code column.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.