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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.