Forum Discussion

George1973's avatar
George1973
Icon for Helper V rankHelper V
4 years ago
Solved

One Product, two suppliers - Latest Vendor Code

Hi All,   I have an issue, with this following table and formula:   There is one product having two difference supplier. For the purpose of the further filtering, I need to seperate them, s...
  • SpartaBI's avatar
    SpartaBI
    4 years ago

    George1973 ok, try this:

     

    Supplier Final Code = 
    VAR _current_kod = 'Supplier and Goods'[Goods_KOD]
    VAR _max_rank_for_this_supplier = 
    	CALCULATE(
    		MAX('Supplier and Goods'[Supplier_rank),
    		REMOVEFILTERS('Supplier and Goods'),
    		'Supplier and Goods'[Goods_KOD] = _current_kod
    	)
    VAR _result = 
    	CALCULATE(
    		SELECTEDVALUE(('Supplier and Goods'[Supplier_LookUP),
    		REMOVEFILTERS('Supplier and Goods'),
    		'Supplier and Goods'[Goods_KOD] = _current_kod,
    		'Supplier and Goods'[Supply Rank] = _max_rank_for_this_supplier
    	)
    RETURN
    	_result
    		

     

     


    Showcase Report – Contoso By SpartaBI