Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Multi table values to swap in Matrix Visual

Hello,

Have 3 tables (Regional, Location and Global) with expected sales target.

In Matrix Visual Row need to Swap Target if my Main table Category, Location and Region slicers selection.

Eg:

1. Items selected in Category Slicer but no items selected in Location and Region slicer

THEN Matrix Visual should show Global table Expected Target 

2. Items selected in Location Slicer but no items selected in Category and Region slicer

THEN Matrix Visual should show Location table Expected Target 

3. Items selected in Region Slicer but no items selected in Global and Location slicer

THEN Matrix Visual should show Region table Expected Target 

Ceated Power Bi Matrix Visual with below
  
RowsCategory, Target
ColumnsReport Mnth
Valuesmeasure with Sum -Total sales Values / Sum -Monthly Expected Values

 

Sample main table

CategoryTotal sales ValuesMonthly Expected ValuesReport Mnth
A80110Jan-20
B75100Jan-20
C88120Jan-20
D65100Jan-20
A80110Feb-20
B75100Feb-20
C88120Feb-20
D65100Feb-20
A80110Mar-20
B75100Mar-20
C88120Mar-20
D65100Mar-20
Table 1  
RegionCategoryExpected Target
EMEAA>=85%
EMEAB>=90%
EMEAC>=75%
EMEAD>=95%
APACA>=85%
APACB>=90%
APACC>=75%
APACD>=95%
NAA>=85%
NAB>=90%
NAC>=75%
NAD>=95%
Table 2  
LocationCategoryExpected Target
AAA>=80%
BBB>=85%
CCC>=77%
DDD>=90%
EEA>=80%
FFB>=85%
GGC>=77%
HHD>=90%
IIA>=80%
JJB>=85%
KKC>=77%
LLD>=90%
Table 3 
GlobalCategoryExpected Target
AA>=85%
BB>=90%
CC>=75%
DD>=95%
EA>=85%
FB>=90%
GC>=75%
HD>=95%
IA>=85%
JB>=90%
KC>=75%
LD>=95%

Thanks In advance,

MM

2 Replies

  • Anonymous create a dynamic measure based on selectedvalue function from your slicer to check which value is selected and then create a measure from the respective table:

     

    For example:

     

    Dynamic Measure = 
    VAR __selectedValueSlicer1 = SELECTEDVALUE ( Slicer1Table[Column] )
    VAR __selectedValueSlicer2 = SELECTEDVALUE ( Slicer2Table[Column] )
    SWITCH ( TRUE(),
     __selectedValueSlicer1 <> BLANK() && __selectedValueSlicer2 == BLANK(), SUM ( Table1[Value] ),
     __selectedValueSlicer1 = BLANK() && __selectedValueSlicer2 <> BLANK(), SUM ( Table2[Value] )
    )
    
    

     

    you can build the conditions based on your business rules.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your reply. Will check and let you know.

      Regards,

      MM