Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
irfandbintang
Frequent Visitor

How to Build a Stacked column chart by distinct count by category

Hi Good Morning All, i want to ask about my case. So what i want to build is a stacked column chart, the axis is Location, legend is the delivery status (delay/not), value is total unique shipment(there are multiple shipment number).
 
What i want to ask is how i can calculate the distinctcount of shipment by Location? 1 Shipment number can be in multiple row & Location. For reference i give the snapshot of my dataset:
 
Would really appreciate if someone know the answer/formula. Thanks All 😁
 
Capture.PNGCapture1.PNG
1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hello @irfandbintang ,

You could try it that way.

Measure = CALCULATE(DISTINCTCOUNT('Table'[Shipment ]),ALLEXCEPT('Table','Table'[Location]))

Reference: ALLEXCEPT

DISTINCTCOUNT

Best regards

Stephen Tao

If this post helps,then consider Accepting it as the solution to help other members find it faster.

View solution in original post

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @irfandbintang ,

Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.


Best Regards,
Stephen Tao

v-stephen-msft
Community Support
Community Support

Hello @irfandbintang ,

You could try it that way.

Measure = CALCULATE(DISTINCTCOUNT('Table'[Shipment ]),ALLEXCEPT('Table','Table'[Location]))

Reference: ALLEXCEPT

DISTINCTCOUNT

Best regards

Stephen Tao

If this post helps,then consider Accepting it as the solution to help other members find it faster.

amitchandak
Super User
Super User

@irfandbintang , not very clear. You can use location on axis and distinctcount(Table[Shipemnt])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.