Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Lucy8466
Frequent Visitor

Switch set of columns in table/matrix according to slicer

Hello

I have a slicer with alarm names and I  need to switch appropriate set of columns acording to selected alarm name in a table visual. 

For example: 

If I select  Alarm1  in my slicer, I need to see in a table visual columns A,B,C from my fact table.

then if I select Alarm2 I need to see columns B,D,E

I can`t unpivot columns , because I have around 82 milions of rows and around 100 columns. They are data from IoT.

I tried:

Dynamic_columns =

SWITCH(

SELECTEDVALUE('Alarm'[code]),

"Alarm1", SELECTCOLUMNS(Fact,"A",[SUM A], "B", [SUM B], "C", [SUM C]),

"Alarm2", SELECTCOLUMNS(Fact,"B", [SUM B], "D", [SUM D], "E", [SUM E]),

Blank() ) 

But it didn`t worked.

Can you help me?
this is Fact table: 

DateABCDE
01/01/202312.613.610.513.512.4
02/01/202313.614.611.514.513.4
03/01/202311.412.49.312.311.2
04/01/20236.77.74.67.66.5
05/01/2023151612.915.914.8
06/01/202312-1.11.90.8
07/01/202323-0.12.91.8
08/01/2023131410.913.912.8
09/01/2023202117.920.919.8
10/01/2023784.97.96.8

 

this is Alarm table

code
Alarm1
Alarm2

result I need:

Lucy8466_0-1701452530456.png

Lucy8466_1-1701452547521.png

 

 

 

5 REPLIES 5
PijushRoy
Super User
Super User

Hi @Lucy8466 

Can you look into the Field Parameter? 
https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters 
 https://www.youtube.com/watch?v=-nqEv2YXLsU

If solved your requirement, please mark this answer as SOLUTION.
If this comment helps you, appreciate your KUDOS 👍

 

Thanks
Pijush

Hello I watched the video ,
but I can`t see how it can help me. I don`t need a different breakdowns of 1 column, but I need to switch couple of columns in a table visual that are valid to show if I select Alarm1 in slicer and another set of columns  if I select value Alarm2 in my slicer.
Maybe can you explain more how the field parameters can be used in this case?
thank you

Hi @Lucy8466 

Can you please share sample data (excel format)
and 
expected result in (excel or image)

Hello yes sure I just don`t know how to attach attachment. could you please send me in private message your email where can I send excel and simple pbi?
results should be: 

Lucy8466_0-1701436289215.pngLucy8466_1-1701436322092.png

 

@PijushRoy here it is:
Fact table

DateABCDE
01/01/202312.613.610.513.512.4
02/01/202313.614.611.514.513.4
03/01/202311.412.49.312.311.2
04/01/20236.77.74.67.66.5
05/01/2023151612.915.914.8
06/01/202312-1.11.90.8
07/01/202323-0.12.91.8
08/01/2023131410.913.912.8
09/01/2023202117.920.919.8
10/01/2023784.97.96.8

 

Alarm table with one column code:

code
Alarm1
Alarm2

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.