The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
I have a order table where each product in an order has their own orderrow.
Im trying to tag all orderrows in an order that has the same salestime, so for example, if i have an order with 4 items and 3 of them was sold at the same time, i want those marked. I only want this behaviour if it is 2 or more rows in an order with the saletime.
so the table consists of the following rows:
order_id,orderrow_id,product_id,quantity,price,salestime
Any ideas?
Solved! Go to Solution.
Hi @Trolleri ,
According to your description, you can create a calculated column to count the number of rows under an order that meet the sales time on the same day greater than 2. Then apply a custom background-color to order_id. refer to the following test results.
row_ =
CALCULATE (
COUNTROWS ( 'Table' ),
ALL ( 'Table' ),
'Table'[order_id] = EARLIER ( 'Table'[order_id] )
&& 'Table'[salestime] = EARLIER ( 'Table'[salestime] )
)
If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Trolleri ,
According to your description, you can create a calculated column to count the number of rows under an order that meet the sales time on the same day greater than 2. Then apply a custom background-color to order_id. refer to the following test results.
row_ =
CALCULATE (
COUNTROWS ( 'Table' ),
ALL ( 'Table' ),
'Table'[order_id] = EARLIER ( 'Table'[order_id] )
&& 'Table'[salestime] = EARLIER ( 'Table'[salestime] )
)
If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can consider using RANKX function.
How to use RANKX in DAX (Part 1 of 3 - Calculated Columns) - RADACAD
If you can provide your sample data and the required result set, I can provide you with the solution.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
79 | |
77 | |
43 | |
39 |
User | Count |
---|---|
150 | |
117 | |
67 | |
64 | |
56 |