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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Palavs
Regular Visitor

Getting summation of columns using a slicer for each column

I just started with power Bi, and facing a small issue if you can help today please:

I have this table below and need to create a slicer for each column (A prod, B prod and so on)

And in the slicer if I select "A prod" the card should give the summation of all the values in A prod, same for other columns. Even Pie chart or the stacked column graph should change dynamically showing only the product which was selected.

A prodB ProdC ProdD Prod
0.3102620.8675060.0674220.64718
0.0549770.5539230.7899830.234929
0.9848470.9389260.1943940.215597
0.9397730.2305160.7806290.045914
0.9231880.0848720.2510230.570317
0.91070.5630520.5667020.861772
0.8166410.6085470.8019920.429707
0.3729140.1879260.3444870.774162
0.4539820.9202730.5192180.606966
0.0546390.1109960.6111960.110195
0.6797410.3389450.1284940.044924
0.0212610.1717550.8538180.677499
0.5093550.498440.7193110.565606
0.6653350.9574410.4529260.551319
0.2644210.4816840.4072910.59328
0.4931710.4767810.7799190.485332
0.0804030.0314540.7622330.046526
0.8991110.7346760.2650060.426943
0.1277210.0733640.0069530.431879
0.5725040.8728790.9557150.270049
0.2103040.7634870.4787180.545109
0.9219530.4078650.5042240.770659
0.1448750.5004620.5344860.858421
0.9918070.7178680.3862660.208436


Your help would be greatly appreciated

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi, @Palavs 

Please check the below.

I am not sure if I understood your question correctly, but one of the many ways I selected is to transform the table like below. In the power query editor, select four columns and click unpivot. Then the table can be transformed to the below.

Please check the pbix file's link down below.

 

 

 

Picture1.png

 

https://www.dropbox.com/s/s96ml2cxuo3jso0/palavs.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

v-rzhou-msft
Community Support
Community Support

Hi @Palavs 

If you don't want to change your data model, you can try my way to get summation by dax.

Firstly, we need to build a slicer table.

1.png

Build a calculated column as below.

Summation =
SWITCH (
    TRUE (),
    Slicer[Category] = "A Prod", SUM ( 'Table'[A prod] ),
    Slicer[Category] = "B Prod", SUM ( 'Table'[B Prod] ),
    Slicer[Category] = "C Prod", SUM ( 'Table'[C Prod] ),
    SUM ( 'Table'[D Prod] )
)

Result:

2.png3.png

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @Palavs 

If you don't want to change your data model, you can try my way to get summation by dax.

Firstly, we need to build a slicer table.

1.png

Build a calculated column as below.

Summation =
SWITCH (
    TRUE (),
    Slicer[Category] = "A Prod", SUM ( 'Table'[A prod] ),
    Slicer[Category] = "B Prod", SUM ( 'Table'[B Prod] ),
    Slicer[Category] = "C Prod", SUM ( 'Table'[C Prod] ),
    SUM ( 'Table'[D Prod] )
)

Result:

2.png3.png

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Jihwan_Kim
Super User
Super User

Hi, @Palavs 

Please check the below.

I am not sure if I understood your question correctly, but one of the many ways I selected is to transform the table like below. In the power query editor, select four columns and click unpivot. Then the table can be transformed to the below.

Please check the pbix file's link down below.

 

 

 

Picture1.png

 

https://www.dropbox.com/s/s96ml2cxuo3jso0/palavs.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

Start with this: https://youtu.be/AuYzsfXKkbM

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.