Forum Discussion
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
- amitchandak
Super User
Can you share sample data and sample output.
- IvaStrezevaFrequent Visitor
Hello,
Here are the tables:
Customer name Invoice Ref Product Name Amount Customer 1 Invoice 1 Product 1 2.00 Customer 2 Invoice 2 Product 1 1.50 Customer 1 Invoice 1 Product 2 4.00 Product name Threshold amount Product 1 3.00 Product 2 2.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
Community 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.