Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 14 | |
| 10 | |
| 6 | |
| 5 |