Forum Discussion

kanth123's avatar
kanth123
Icon for Helper I rankHelper I
4 years ago
Solved

Filter 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. 

DateSales RepRegionAccountProductAmountUnitsUnitPrice (Amount/Units)
1/1/2022MattEast1004A200540
1/1/2022MattEast1004B100520
1/1/2022AlexWest1002C150350
1/2/2022DavidSouth1003D1001100
1/2/2022MattEast1003D2002100
1/2/2022AlexWest1004A100250

 

Above flag is not working in this case. expected Amount for Matt is 400 but its showing 500. Any suggestions to fix flag. 

 

RegionSales RepSalesExpected amount
EastMatt500400
WestAlex250250
SouthDavid100100

 

Thanks in advance. 

 

  • Seanan's avatar
    Seanan
    4 years ago

    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.

6 Replies

      • Seanan's avatar
        Seanan
        Icon for Solution Supplier rankSolution Supplier

        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.