Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Earlier, I have received great help with this issue, but it turned out my table was more complex than I realised, and the solution ceased working as desired. I have tried to tweak on my measures, but to help avail.
I wish to create a report where stores with 0 sales of a product is listed (regardless of packaging).
The data table has a structure like this:
| Store | ProductCategory | Product | Sales |
| Store A | Alfa | Product A - Single | 0 |
| Store A | Alfa | Product A - Multipack | 4 |
| Store A | Bravo | Product B - Single | 0 |
| Store A | Bravo | Product B - Multipack | 0 |
| Store B | Alfa | Product A - Single | 0 |
| Store B | Alfa | Product A - Multipack | 8 |
| Store B | Bravo | Product B - Single | 10 |
| Store B | Bravo | Product B - Multipack | 0 |
I have two measures:
1.
| ProductCategory | ||
| Store | Alfa | Bravo |
| Store A | 0 |
| ProductCategory | ||
| Store | Alfa | Bravo |
| Store A | 4 | 0 |
Any suggestions on what I must change to get to the desired result?
/depple
Solved! Go to Solution.
Hi @depple ,
We can create two calculated columns to work on it.
Column = var sum1= CALCULATE(SUM('Table 1'[Sales]),ALLEXCEPT('Table 1','Table 1'[Store],'Table 1'[ProductCategory]))
return
IF(sum1=0,'Table 1'[Store],BLANK())
New store = IF('Table 1'[Store] in VALUES('Table 1'[Column]),'Table 1'[Store],BLANK())
Please find the pbix as attached.
Regards,
Frank
Hi @depple ,
We can create two calculated columns to work on it.
Column = var sum1= CALCULATE(SUM('Table 1'[Sales]),ALLEXCEPT('Table 1','Table 1'[Store],'Table 1'[ProductCategory]))
return
IF(sum1=0,'Table 1'[Store],BLANK())
New store = IF('Table 1'[Store] in VALUES('Table 1'[Column]),'Table 1'[Store],BLANK())
Please find the pbix as attached.
Regards,
Frank
Thanks a million! It worked perfect, and it also sorted out some other difficulties that I had.
/depple
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 45 | |
| 34 | |
| 27 | |
| 15 | |
| 15 |
| User | Count |
|---|---|
| 58 | |
| 56 | |
| 38 | |
| 21 | |
| 21 |