Forum Discussion
kanth123
Helper I
4 years agoFilter data based on Sales Price
Hi,
Created a calculated Measure "Flag" based on below logic . User can choose either Include or Exlcude.
Unit Price = Sum(Amount)/Sum(Units)
Flag = if [Unit Price] > 25,"Include","Exlcude" .
Flag is working as expected when Product and Account are present in visualization.
| Date | Sales Rep | Region | Account | Product | Amount | Units | UnitPrice (Amount/Units) |
| 1/1/2022 | Matt | East | 1004 | A | 200 | 5 | 40 |
| 1/1/2022 | Matt | East | 1004 | B | 100 | 5 | 20 |
| 1/1/2022 | Alex | West | 1002 | C | 150 | 3 | 50 |
| 1/2/2022 | David | South | 1003 | D | 100 | 1 | 100 |
| 1/2/2022 | Matt | East | 1003 | D | 200 | 2 | 100 |
| 1/2/2022 | Alex | West | 1004 | A | 100 | 2 | 50 |
Above flag is not working in this case. expected Amount for Matt is 400 but its showing 500. Any suggestions to fix flag.
| Region | Sales Rep | Sales | Expected amount |
| East | Matt | 500 | 400 |
| West | Alex | 250 | 250 |
| South | David | 100 | 100 |
Thanks in advance.
Hi kanth123
Please try using this measure for the flag
Flag = CALCULATE(SUM('Units'[Amount]),FILTER(Units,'Units'[UnitPrice] > 25))Kind regards,
Seanan
If this post helped, please consider accepting it as the solution.