Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

SUM WITH IF OR CONDITION

Can somebody help put this into Power BI? IF or DAX? I just started and i am kind of stuck

 

SUM(IF [Days Bucket] = "<30 Days"
OR [Days Bucket] = "30-69 Days"
OR [Days Bucket] = "70-100 Days"
OR [Days Bucket] = "101-140 Days"
OR [Days Bucket] = "141-180 Days"
OR [Days Bucket] = ">180 Days"
THEN [Available Inventory (RS Inventory - Total RS Demand)] ELSE NULL END)

 

Feedback will be appreciated.

3 Replies

  • Anonymous , Try a measure like

     

    sumx(filter(table, Table[Days Bucket] in {"<30 Days","30-69 Days","70-100 Days","101-140 Days","141-180 Days",">180 Days"}), [Available Inventory (RS Inventory - Total RS Demand)])

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello amitchandak it's not working on my end. see below:

       

       


      the output should be below (total inventory column):

       

       

  • V-lianl-msft's avatar
    V-lianl-msft
    Icon for Community Support rankCommunity Support

    Unfortunately,I don't understand the meaning of your formula. could you share the sample data and expected results so that we can use DAX to help you solve the problem.