Forum Discussion

cryspezz's avatar
cryspezz
Frequent Visitor
3 years ago
Solved

Lookup Closest Suggested Price

Hello,   I am working on a project that helps our Pricing team identify areas where a customer isn't following our suggested pricing.   We offer a suggested pricing structure to the wholesaler, w...
  • ryan_mayu's avatar
    3 years ago

    cryspezz 

    you can try this

    Measure = 
    VAR _low=maxx(FILTER('Suggested Price','Suggested Price'[Date]=max('Sales'[Date])&&'Suggested Price'[Customer]=max(Sales[Customer])&&'Suggested Price'[Product]=max(Sales[Product])&&'Suggested Price'[Suggested Price]<=max(Sales[ Sales Price ])),'Suggested Price'[Suggested Price])
    VAR _high=minx(FILTER('Suggested Price','Suggested Price'[Date]=max('Sales'[Date])&&'Suggested Price'[Customer]=max(Sales[Customer])&&'Suggested Price'[Product]=max(Sales[Product])&&'Suggested Price'[Suggested Price]>=max(Sales[ Sales Price ])),'Suggested Price'[Suggested Price])
    VAR _diff1=ABS(_low-max(Sales[ Sales Price ]))
    VAR _diff2=ABS(_high-max(Sales[ Sales Price ]))
    return if (_diff1<=_diff2,_low,_high)
    
    
    Measure 2 = [Measure]-max(Sales[ Sales Price ])

     

    pls see the attachment below