Forum Discussion

chinma's avatar
chinma
Frequent Visitor
2 years ago
Solved

Create Conditional Column from another RankBased Conditional Column

Hi Team, I have a table (UniqueVendors) with columns (VendorName,VendorRank). Query for this table: " UniqueVendors = UNION(DISTINCT('Vendor Vs Inventory'[VMNAME]),DATATABLE("VendorName",STRING,{{...
  • parry2k's avatar
    2 years ago

    chinma you can use new RANK function to add the column:

     

    Target Vendor Name = 
    VAR __Rank = RANK ( DENSE, ALLSELECTED ( VendorTable ), ORDERBY ( [TotalSales], DESC ), 
    MATCHBY ( VendorTable[VendorName] ) )
    RETURN
    IF ( __Rank <= 3, VendorTable[VendorName], "Others" )