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
I have a sale table that looks like this:
| BookingDate | ShopId | ArticleId | QtyPieces |
| 10/05/2023 | 704788 | 31452 | 6 |
| 10/05/2023 | 704788 | 30891 | 1 |
| 10/05/2023 | 704788 | 30544 | 10 |
And would like to know how many shops have sold at least 4 total quantity for each of the articles
My matrix is setup as following
the values are:
Distinct count of shops, sum of QtyPieces and Distinct count of shops where at least 4 of the article is sold.
CALCULATE(
DISTINCTCOUNT(F_Sales_22May23[ClientId]),
FILTER(
F_Sales_22May23,
SUM(F_Sales_22May23[QtyPieces])> 4
)
)
the result is
because the formulla evaluates for each filter context individually, the number of distinct shops = number of shops with at least 4 in quantity sales.
How do i rewrite the formulla so the totals only count shops that have less than 4 Qty sales.
Instead of
FILTER(
F_Sales_22May23,
SUM(F_Sales_22May23[QtyPieces])> 4
)
use
FILTER(
F_Sales_22May23,
[QtyPieces]> 4
)
or
F_Sales_22May23[QtyPieces]> 4
Same with the <4 approach.
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.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 11 | |
| 9 | |
| 5 | |
| 5 |