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
krider71
Frequent Visitor

Want Distinct count of a Brand that matches a specific criteria each week - so each week is counted

Hello,

I have searched all over for this answer and cannot find anything similar.  

I have 4 years of data and I want to be able to say Brand A was promoted 25 times in 2019 and 27 weeks Non Promoted and then x# of times in 2020, etc.  Or say the same thing in  a month or however many of weeks selected in my slicer. In my example below I have 2 weeks of data and want to say in those two weeks Brand A = 1 Week Promoted and 1 Week Non Promoted

 

But when I do anything like a CountA I get the number of rows that Brand A was listed in a week (numerous times since many items make up that brand) Promo or Non Promo...so for on

e month I got Brand A = 633 vs 4 weeks Promoted.  

 

TY #ofWeeks Promo VT = (COUNTA(SalesVT[PROMOTIONS])) and have tried
Distinctcount Promos = DISTINCTCOUNT(SalesVT[PROMOTIONS]) this gives me a 1for Promo and Non Promo

 

 

My Data Table is called SalesVT

 

Item Description

BrandWeek EndedSalesPROMOTIONS
Item 1Brand A1/5/2019$1,000Promo
Item 2Brand A1/5/2019$2,000Promo
Item 3Brand B1/5/2019$1,500Non Promo
Item 3Brand B1/5/2019$700Non Promo
Item 4Brand B1/12/2019$500Non Promo
Item 5Brand A1/12/2019$800Non Promo
Item 6Brand A1/5/2019$900Promo
Item 7Brand B1/12/2019$200Non Promo
Item 6Brand A1/5/2019$900Promo
Item 7Brand B1/12/2019$200Non Promo
     
I want the Table to look like the following : Assume 2 Weeks in Data:
 Non PromoPromo  
Brand A11  
Brand B20 

 

 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@krider71 

you can try this

non promo = CALCULATE(DISTINCTCOUNT('Table'[Week Ended]),'Table'[PROMOTIONS]="Non Promo")

promo = CALCULATE(DISTINCTCOUNT('Table'[Week Ended]),'Table'[PROMOTIONS]="Promo")+0

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
krider71
Frequent Visitor

Thank you! It worked!  I guess I was thinking it would be one formula and not 2.  Now onward to getting my average sales by these formulas to work! You may hear from me again!

 

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@krider71 

you can try this

non promo = CALCULATE(DISTINCTCOUNT('Table'[Week Ended]),'Table'[PROMOTIONS]="Non Promo")

promo = CALCULATE(DISTINCTCOUNT('Table'[Week Ended]),'Table'[PROMOTIONS]="Promo")+0

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.