Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jwin2424
Resolver I
Resolver I

Count orders based on conditions from other columns

Here is a small dataset sample. I have a single table and no connecting relationships. 

Run DateOrder #On ATPOrder on ATP
8/9/20231TRUETRUE
8/9/20231TRUETRUE
8/9/20231TRUETRUE
8/9/20232FALSEFALSE
8/9/20232TRUEFALSE
8/9/20232FALSEFALSE
8/10/20231TRUETRUE
8/10/20231TRUETRUE
8/10/20231TRUETRUE
8/10/20232FALSEFALSE
8/10/20232TRUEFALSE
8/10/20232FALSEFALSE
8/11/20231TRUETRUE
8/11/20231TRUETRUE


Each day, I need to determine if the entire order is on ATP or not. The desired result is the last column. As you can see, not all order lines are on ATP. I need a column or measure that returns a TRUE statement if the all lines on the order for that day are TRUE for On ATP. 

Hope that makes sense. 

 

Thanks, 

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

Simple enough,

ThxAlot_0-1712504569780.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

4 REPLIES 4
ThxAlot
Super User
Super User

Simple enough,

ThxAlot_0-1712504569780.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Thank you! I was using EARLIER on run date, but not on order #. 

tamerj1
Super User
Super User

Hi @jwin2424 

please try

Order on ATP =
VAR CurrentOrderATPs =
CALCULATETABLE (
VALUES ( 'Table'[On ATP] ),
ALLEXCEPT ( 'Table', 'Table'[Run Date], 'Table'[Order #] )
)
RETURN
IF ( COUNTROWS ( CurrentOrderATPs ) = 1, CurrentOrderATPs, FALSE )

As a side note, this worked as well. Thank you

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.