Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello everyone,
I have created a matrix visual wit a dimension in rows (Store), a dimension in columns (Product) and with a calculated measure as Value (Measure1).
I need to show only the Stores with non-empty value in both A and B products. In the example above, I would need to display only Stores 3, 4, 6 and 7.
The number of products changes depending on a report level filter.
I have tried to solve it with the instructions in this link, but my case is slightly different because I do not filter the products explicitly. Products are filtered throught a related field in another table.
Measure =
IF (
CALCULATE ( DISTINCTCOUNT ( Table1[Product] ), ALLSELECTED ( Table1[Product] ) )
= COUNTROWS ( ALLSELECTED ( Table1[Product] ) ),
SUM ( Table1[Units] )
)The first part of the condition is correct, it returns the number of products with units on each store.
However, the second part of the condition is not working as I would like, because it returns the count of all products (432), without taking into account the implicit filters of products.
Could you be so kind to help me solving this issue?
Thank you so much in advance.
Solved! Go to Solution.
Finally, I solved the issue changing the second condition of the IF in the measure, like this:
Measure =
IF(
CALCULATE(
DISTINCTCOUNT(Table1[Product]);
ALLSELECTED(Table1[Product])
)
=
CALCULATE(
DISTINCTCOUNT(Table1[Product]);
ALLSELECTED(Table1[Product]);
ALLSELECTED(Table1[Store])
);
SUM(Table1[Units]))
Finally, I solved the issue changing the second condition of the IF in the measure, like this:
Measure =
IF(
CALCULATE(
DISTINCTCOUNT(Table1[Product]);
ALLSELECTED(Table1[Product])
)
=
CALCULATE(
DISTINCTCOUNT(Table1[Product]);
ALLSELECTED(Table1[Product]);
ALLSELECTED(Table1[Store])
);
SUM(Table1[Units]))
Hi @Anonymous,
I cannot view your pic as you shared. Could you please share your sample data and excepted result again? You can upload your files to onedrive and share the link here.
Regards,
Frank
Can you put your Measure in a Visual Filter and filter out the values that way?
Hi @Greg_Deckler,
Thanks for your answer but it doesn't work.
When I filter the measure by "is not blank" I get exactly the same results because there are non blank values at least for one product of each row of the matrix.
When I filter by "is greater than 0" I also get the same rows, because there is at least one value greater than 0 in the row.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
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 |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |