Forum Discussion
Show only Selected columns based on Disconnected slicer
- 2 years ago
create the following table :
Quarters | KEY
Q1 & Q2 |Q1
Q1 & Q2 | Q2
Q2 & Q3| Q2
Q2 & Q3 | Q3
Q3 & Q4 | Q3
Q3 & Q4 | Q4UNPIVOT THE ABOVE THE TABLE with poewr query
steps :
step1 : select the column person
step2 : go to transform --> unpivot other columns ( near unpivot, there is a down arrow . click on it and select unpivot other columns ) ,
now you will have a table as below :
next step,
use rreplace values from power query and replace : " Att" with blank
almost there.....
now click close and apply.
create a link between the 2 tables on key -- attribute,
you are good to go .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅!
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠 - 2 years ago
Hi patilpoonam21 ,
Based on your description,
I created some data:
Table:Table 2:
Please try the following code to create Measure.
Q1 Measure = IF ( CONTAINSSTRING ( SELECTEDVALUE ( 'Table 2'[Quarters] ), "Q1" ), SUM ( 'Table'[Q1 Att] ), BLANK () )Q2 Measure = IF ( CONTAINSSTRING ( SELECTEDVALUE ( 'Table 2'[Quarters] ), "Q2" ), SUM ( 'Table'[Q2 Att] ), BLANK () )Q3 Measure = IF ( CONTAINSSTRING ( SELECTEDVALUE ( 'Table 2'[Quarters] ), "Q3" ), SUM ( 'Table'[Q3 Att] ), BLANK () )Q4 Measure = IF ( CONTAINSSTRING ( SELECTEDVALUE ( 'Table 2'[Quarters] ), "Q4" ), SUM ( 'Table'[Q4 Att] ), BLANK () )Measure 1 = VAR _sel = SELECTEDVALUE('Table 2'[Quarters], "All") RETURN SWITCH( _sel, "Q1 & Q2",[Q1 Measure], "Q2 & Q3",[Q2 Measure], "Q3 & Q4",[Q3 Measure] )Measure 2 = VAR _sel = SELECTEDVALUE('Table 2'[Quarters], "All") RETURN SWITCH( _sel, "Q1 & Q2",[Q2 Measure], "Q2 & Q3",[Q3 Measure], "Q3 & Q4",[Q4 Measure] )The field of the slicer is from Table 2. When you select "Q1 & Q2" in the slicer, Result is as below.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
create the following table :
Quarters | KEY
Q1 & Q2 |Q1
Q1 & Q2 | Q2
Q2 & Q3| Q2
Q2 & Q3 | Q3
Q3 & Q4 | Q3
Q3 & Q4 | Q4
UNPIVOT THE ABOVE THE TABLE with poewr query
steps :
step1 : select the column person
step2 : go to transform --> unpivot other columns ( near unpivot, there is a down arrow . click on it and select unpivot other columns ) ,
now you will have a table as below :
next step,
use rreplace values from power query and replace : " Att" with blank
almost there.....
now click close and apply.
create a link between the 2 tables on key -- attribute,
you are good to go .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅!
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠