Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi guys, all I want to do is simply count all sales orders that contains at least 1 of the products for a selected order. My forumla is shown below. Essentially just confused on how to use contains or containsstring to essentially search for shared values.
Solved! Go to Solution.
I will call you table Sales. I assume you are using a card visual. You may try
No of Orders =
VAR SelectedProductds =
VALUES ( Sales[Products] )
VAR CorrespongingSales =
FILTER ( ALL ( Sales ), Sales[Products] IN SelectedProductds )
VAR CorrespondingOrders =
DISTINCT ( SELECTCOLUMNS ( CorrespongingSales, Sales[Order No] ) )
RETURN
COUNTROWS ( CorrespondingOrders )
@cdawidow2
How does your data look like. Can you share screenshots of the tables and the date model blanking out any sensitive data.
I only have 1 table - products and orders are in the same table. So if an order has 4 products associated with it then it would have 4 lines
I will call you table Sales. I assume you are using a card visual. You may try
No of Orders =
VAR SelectedProductds =
VALUES ( Sales[Products] )
VAR CorrespongingSales =
FILTER ( ALL ( Sales ), Sales[Products] IN SelectedProductds )
VAR CorrespondingOrders =
DISTINCT ( SELECTCOLUMNS ( CorrespongingSales, Sales[Order No] ) )
RETURN
COUNTROWS ( CorrespondingOrders )
Works perfectly! thank you so much!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
25 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |