Forum Discussion
Sasha
7 years agoHelper III
Comparing field to itself
I have the following data about ownership of barbers in three barber shops I'm interested presenting a matrix on PBI where the rows are barbers that are owners in at least one barber shop and th...
- 7 years ago
Sasha ,
Drag [Barber] from Table2 to Rows and add measure below.
Table2 = FILTER ( Table1, Table1[Status] = "Owner" )
Measure = SWITCH ( TRUE (), SELECTEDVALUE ( Table2[Barber] ) = SELECTEDVALUE ( Table1[Barber] ), "Same Person", NOT ( ISEMPTY ( FILTER ( Table1, Table1[BarberShop] IN VALUES ( Table2[BarberShop] ) && Table1[Status] = "Owner" ) ) ), "Owners", NOT ( ISEMPTY ( FILTER ( Table1, Table1[BarberShop] IN VALUES ( Table2[BarberShop] ) ) ) ), "Owner-Tenant" )
v-chuncz-msft
7 years agoCommunity Support
Sasha ,
Drag [Barber] from Table2 to Rows and add measure below.
Table2 = FILTER ( Table1, Table1[Status] = "Owner" )
Measure =
SWITCH (
TRUE (),
SELECTEDVALUE ( Table2[Barber] ) = SELECTEDVALUE ( Table1[Barber] ), "Same Person",
NOT (
ISEMPTY (
FILTER (
Table1,
Table1[BarberShop] IN VALUES ( Table2[BarberShop] )
&& Table1[Status] = "Owner"
)
)
), "Owners",
NOT (
ISEMPTY (
FILTER ( Table1, Table1[BarberShop] IN VALUES ( Table2[BarberShop] ) )
)
), "Owner-Tenant"
)
Sasha
7 years agoHelper III
v-chuncz-msft how can I sort the columns of the output in my example so all the the barbers that have "the same" person will appear first similarly to the order they appear in the rows and only after that the rest barbers (that basically only rent) will appear in the columns. In this case, the diagonal will be continuous and this will obviously be more pleasing visually.