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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Counting items within a category - Dax

Hi Community,

 

I am stuck with a rather simple looking calculation - but I cannot make any logic towards resolution.

It would be of great help if anyone can please provide any direction.

 

I am working on a problem, where I got main frenchise company - calling here, store chain name - say {Pizza_Plannet, The_Pizza_Shop ,etc} 

then I got list of indivdual store within that chain - say {Pizza_plannet_Sydney, Pizza_plannet_Melbourne, The_Pizza_Shop_Sydney, etc}

then there are certain products which each individual store is selling, like pizza, colddrink, cookie

 

All I want to know is, within the main company, how many stores are selling each product & the percentage of stores

say only pizza plannet sydney sold cookies , so cookies for pizza plannet will be sold at 50 % of the pizza plannet stores,

while all stores of The_Pizza_Shop are selling cookies, so cookies for The_Pizza_Shop will be 100%.

 

below is a tabular snapshot

2018-08-13 16 58 14.png

Any help in this regard would be extremely helpful and appriciated.

Thanks & regards

emudria.

1 ACCEPTED SOLUTION

@Anonymous

 

See file attached

 

ciw.png


Regards
Zubair

Please try my custom visuals

View solution in original post

5 REPLIES 5
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Try this calculated Column

 

Count of Total Stores in each Chain =
CALCULATE (
    DISTINCTCOUNT ( Table1[individual store] ),
    ALLEXCEPT ( Table1, Table1[store chain name] )
)

Regards
Zubair

Please try my custom visuals

@Anonymous

 

And this one

 

Count of stores selling a product within each chain =
CALCULATE (
    DISTINCTCOUNT ( Table1[individual store] ),
    ALLEXCEPT ( Table1, Table1[store chain name], Table1[Product] )
)

Regards
Zubair

Please try my custom visuals

@Anonymous

 

See file attached

 

ciw.png


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Thank you @Zubair_Muhammad, it is giving me the right numbers as long as I have dimensions in the table, ie chain, individual store, month, product - but I cannot roll these numbers. Can I make any change here to roll the numbers?

@Anonymous

 

Hi

 

What is meant by rolling?

 


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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