Forum Discussion

IvaStrezeva's avatar
IvaStrezeva
Frequent Visitor
6 years ago
Solved

DAX : Threshold trigger for product amount

Hello all,

 

I am a begginer user of Power BI and I would need help to set a treshold trigger for my data. Here are the tables:

1st Customer name, Invoice ref., Contract product and Amount

2nd Contract product and Threshold

 

For each Invoice ref. I would like the function to go and check for the Contract product in that invoice if the Amount is greater than the Threshold?

 

Thank you in advance!

 

  • Hi IvaStrezeva ,

     

    Please create a calculated column like that to work on it.

    Column = 
    VAR ta =
        CALCULATE (
            MAX ( 'Product'[Threshold amount] ),
            FILTER ( 'Product', 'Product'[Product name] = Customer[Product Name] )
        )
    RETURN
        IF ( Customer[Amount] > ta, "Over threshold", "ok" )
    

     

    Pbix as attached.

     

7 Replies

    • IvaStrezeva's avatar
      IvaStrezeva
      Frequent Visitor

      Hello,

       

      Here are the tables:

      Customer nameInvoice RefProduct NameAmount
      Customer 1Invoice 1Product 12.00
      Customer 2Invoice 2Product 11.50
      Customer 1Invoice 1Product 24.00

       

      Product nameThreshold amount
      Product 13.00
      Product 22.00

       

      So the result would be that on Invoice 1 (row 3 of the first table) the amount for Product 2 (4.00) is greater than the Threhold amount for Product 2 (2.00).

      Hope I wrote it for you to understand my requirement..

       

      • v-frfei-msft's avatar
        v-frfei-msft
        Icon for Community Support rankCommunity Support

        Hi IvaStrezeva ,

         

        Please create a calculated column like that to work on it.

        Column = 
        VAR ta =
            CALCULATE (
                MAX ( 'Product'[Threshold amount] ),
                FILTER ( 'Product', 'Product'[Product name] = Customer[Product Name] )
            )
        RETURN
            IF ( Customer[Amount] > ta, "Over threshold", "ok" )
        

         

        Pbix as attached.