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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Daavs
Frequent Visitor

Count per Store and Type

Hello everyone,

 

I'm trying to set up a calculation where I can get the distinct count from a product per store and per date.
Im getting almost there, but when I have a store within that month and with two types, it only counts one instead of two!

Daavs_0-1658925030287.png

This total should be 158 anod not 144. The missing 14 are the repeated ones. For example, in march, store A as type A and B, but it counts only one type

I've used this :

ark teste sum = CALCULATE(SUMX (DISTINCT(DimCalendar[YYYY-MM]),[arks_test]))
where arkas is :
arks_test= CALCULATE(COUNT(DimLocations[Store]),FILTER(FctArkCheck,FctArkCheck[Ark Check Implemented] > 0))

Thank you!
1 ACCEPTED SOLUTION

Hello @Greg_Deckler 

Thank you for your feedback!
indeed, I tought the same with the distinct. It should be distinct store per YYYY-MM and Display.
By doing so, should be able to see distinct per type and per YYYY-MM.
I have a workaround, but perfomance wise dont know if its the best approach. I got the distinct from YYYY-MM, then the distinct from Type and for last the distinct from store.
So basically, im applying ark teste sum = CALCULATE(SUMX (DISTINCT(DimCalendar[YYYY-MM]),[arks_test])) for 3 times.

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Daavs This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

Also, the issue is likely related to your use of DISTINCT as if there are repeats, DISTINCT will only return distinct rows.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hello @Greg_Deckler 

Thank you for your feedback!
indeed, I tought the same with the distinct. It should be distinct store per YYYY-MM and Display.
By doing so, should be able to see distinct per type and per YYYY-MM.
I have a workaround, but perfomance wise dont know if its the best approach. I got the distinct from YYYY-MM, then the distinct from Type and for last the distinct from store.
So basically, im applying ark teste sum = CALCULATE(SUMX (DISTINCT(DimCalendar[YYYY-MM]),[arks_test])) for 3 times.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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