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

View all the Fabric Data Days sessions on demand. View schedule

Reply
krishna_murthy
Helper II
Helper II

how to make 3 columns added in dax with filter

hi Team,

 

Requesting please check below concern and do the needful.

i have a Event_type fileld in that many classification but i need to add 3 columns to caclualte cont of orders 

Order quantity = event_type(OUTWARD_ORDER_CANCEL) + event_type( OUTWARD_ORDER_COMPLETE) + event_type( OUTWARD_ORDER_SHIPMENT_DISPATCH)


is that possible make one dax expression ???? finaly i need all 3 columns should be added and show total orders 


Below DAX i have used but getting wrong count values  , please fix it is possible 

Order quantity =
CALCULATE(
    COUNTROWS(order_items),
    FILTER(
        order_items,
       
        RELATED(outward_orders[event_type]) <> "OUTWARD_ORDER_CANCEL" &&
        RELATED(outward_orders[event_type]) <> "OUTWARD_ORDER_COMPLETE" &&
        RELATED(outward_orders[event_type]) <> "OUTWARD_ORDER_SHIPMENT_DISPATCH "
    ))
       
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

HI @krishna_murthy ,

 

Try the following code:

Order quantity =
CALCULATE(
    COUNTROWS(order_items),
    FILTER(
        order_items,
       
 NOT( outward_orders[event_type] in {"OUTWARD_ORDER_CANCEL", "OUTWARD_ORDER_COMPLETE" , "OUTWARD_ORDER_SHIPMENT_DISPATCH " })
    )
)

 

Since you are using the && (and) syntax the values need to be the same I assume that each of your values have only one value so if you add them in a list you can get those rows, since you want to have the different values you need to use the NOT syntax. Since there is a relationship between both tables theres is no need to do the RELATED option


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

HI @krishna_murthy ,

 

Try the following code:

Order quantity =
CALCULATE(
    COUNTROWS(order_items),
    FILTER(
        order_items,
       
 NOT( outward_orders[event_type] in {"OUTWARD_ORDER_CANCEL", "OUTWARD_ORDER_COMPLETE" , "OUTWARD_ORDER_SHIPMENT_DISPATCH " })
    )
)

 

Since you are using the && (and) syntax the values need to be the same I assume that each of your values have only one value so if you add them in a list you can get those rows, since you want to have the different values you need to use the NOT syntax. Since there is a relationship between both tables theres is no need to do the RELATED option


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.