Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi All,
I would need help in calculating numeric distribution, in terms how to exactly set up a formula.
So, in the table below there is "dummy" numbers.
I need formula that will distinct count only those stores where certain product has positive quantity on total.
Pay attention on PRODUCT A, and STORE CODE 1.
PRODUCT NAME | STORE CODE | SALES QUANTITY |
PRODUCT A | 1 | 38 |
PRODUCT B | 1 | 67 |
PRODUCT C | 1 | 22 |
PRODUCT A | 2 | 25 |
PRODUCT A | 1 | -39 |
PRODUCT C | 2 | 34 |
PRODUCT B | 3 | 25 |
PRODUCT A | 4 | 38 |
This is the result i would like to get through formula (i put explanation column only for additional clarification):
PRODUCT | DISTRIBUTION (NUMBER OF STORES) | EXPLANATION | |||||||||
PRODUCT A | 2 | STORE CODES 2 & 4 ---> STORE 1 IS NOT COUNTED BECAUSE THE TOTAL QUANTITY FOR THIS PRODUCT IS -1 | |||||||||
PRODUCT B | 2 | STORE CODES 1 & 3 | |||||||||
PRODUCT C | 2 | STORE CODES 1 & 2 | |||||||||
Thank you very much in advance!
Solved! Go to Solution.
Hi, @Vladimir_NBG
Please check the below picture and the sample pbix file's link down below.
Distribution (Number of stores) =
IF (
ISFILTERED ( 'Table'[PRODUCT NAME] ),
COUNTROWS (
FILTER (
VALUES ( 'Table'[STORE CODE] ),
CALCULATE ( SUM ( 'Table'[SALES QUANTITY] ) ) > 0
)
)
)
https://www.dropbox.com/s/9tebnnhih3fsikd/vladimir.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
Hi, @Vladimir_NBG
Please check the below picture and the sample pbix file's link down below.
Distribution (Number of stores) =
IF (
ISFILTERED ( 'Table'[PRODUCT NAME] ),
COUNTROWS (
FILTER (
VALUES ( 'Table'[STORE CODE] ),
CALCULATE ( SUM ( 'Table'[SALES QUANTITY] ) ) > 0
)
)
)
https://www.dropbox.com/s/9tebnnhih3fsikd/vladimir.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
Thank you Jihvan! I applied it on my data and it works.