Forum Discussion
Create text column based on slicer selection
Quick question - Does it have to be A, B, <vendor>, C, D etc or can it also be A, B, <vendor>, D, E etc? That would be much easier to implement.
If that is acceptable then here is a possible solution. It involves the use of RANKX to create a number sequence and then some character trickery to arrive at the desired outcome. This also limits you to 26 partners in the list 🙂
Measure =
// partner list with sales
var r1 = SELECTEDVALUE('FactTable'[Partner])
// reference tabe just with unique partner names - this feeds the slicer
var r2 = SELECTEDVALUE('Reference'[Partner])
// RANKX returns 1,2,3 etc. We convert that to A, B, C etc
var g = rankx(allselected('FactTable'[Partner]),[v])+64
var r = if(HASONEVALUE('FactTable'[Partner]),
//show the selected partner name if it matches
if(r1=r2,r1,
// mask the other partners
"Partner " & UNICHAR(g)),
// suppress the total as it makes no sense
BLANK())
return r
NOTE: Having done similar exercises in the past I need to warn you. Partners are very smart. They figure out who "Partner C" is in less time than it takes you to send the obfuscated data to them. You may want to apply some randomness to the process and - for example - add a calculated column to your fact table
r = rand()
and then change the above measure v to say
v := average(r)
That will give you a different sort order of the partners every time you refresh the data source.