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
Here is my order table;
Order No | SO Lines | Shipping Condition |
10001 | 10 | Ship as available |
10001 | 20 | Ship as available |
12002 | 10 | Ship complete |
12002 | 20 | Ship complete |
13001 | 10 | Ship as available |
13001 | 20 | Ship as available |
13001 | 30 | Ship as available |
14001 | 10 | Ship as available |
If the shipping condition is 'Ship as available' then each of the order lines is treated separately. While if the order has the shipping condition as 'Ship complete' then the order is treated as 1 and all order lines need to ship together. This means in the above table I have 7 order lines.
I need assistance with the measures;
1. that counts the number of order lines based on shipping conditions, and
2. the other that just gives me the sum total of the count of order lines
Thanks and Regards
Solved! Go to Solution.
Hi,
Please try the below measures, and check the attached pbix file.
Count based on the condition measure: =
VAR available_table =
FILTER ( Data, Data[Shipping Condition] = "Ship as available" )
VAR complete_table =
FILTER (
SUMMARIZE ( Data, Data[Order No], Data[Shipping Condition] ),
Data[Shipping Condition] = "Ship complete"
)
RETURN
COUNTROWS ( available_table ) + COUNTROWS ( complete_table )
Count measure: =
COUNTROWS( Data )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi Jihwan_Kim,
Thank you. The DAX function shared is working as expected.
Regards,
Jajati Dev
Hi,
Please try the below measures, and check the attached pbix file.
Count based on the condition measure: =
VAR available_table =
FILTER ( Data, Data[Shipping Condition] = "Ship as available" )
VAR complete_table =
FILTER (
SUMMARIZE ( Data, Data[Order No], Data[Shipping Condition] ),
Data[Shipping Condition] = "Ship complete"
)
RETURN
COUNTROWS ( available_table ) + COUNTROWS ( complete_table )
Count measure: =
COUNTROWS( Data )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
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 |