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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LuisMedrano
New Member

How to use Multiple columns in same visual

Hi all!

I hope there is a way to do what I want to do Smiley Happy

 

I have this table with the values I need to use in 2 different columns (Ton and Cases) and I want to switch between them in the same visuals (lines, bars, tables, etc) using a slicer or something different.

 

Table.PNG

 

 

I used Unpivot option, however, I will exceed the number 1M rows soon if I do so.

 

Is there any other option I can use??

 

Tks for the support.

 

LM

Lima - Peru

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @LuisMedrano

 

Show a simplified sample as below. First, create the slicer table first. Second, create a measure to get the visual as requested. If it is not your case, please share more details for your scenario so that we could help further on it.

Measure =
IF (
    SELECTEDVALUE ( Slicer[Column1] ) = "Cases",
    CALCULATE ( SUM ( Table2[Cases] ) ),
    IF (
        SELECTEDVALUE ( Slicer[Column1] ) = "Ton",
        CALCULATE ( SUM ( Table2[Ton] ) )
    )
)

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
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

2 REPLIES 2
v-cherch-msft
Employee
Employee

Hi @LuisMedrano

 

Show a simplified sample as below. First, create the slicer table first. Second, create a measure to get the visual as requested. If it is not your case, please share more details for your scenario so that we could help further on it.

Measure =
IF (
    SELECTEDVALUE ( Slicer[Column1] ) = "Cases",
    CALCULATE ( SUM ( Table2[Cases] ) ),
    IF (
        SELECTEDVALUE ( Slicer[Column1] ) = "Ton",
        CALCULATE ( SUM ( Table2[Ton] ) )
    )
)

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TomMartens
Super User
Super User

Hey,

 

I'm not sure if I understand your requirement correctly, but I think this post will provide what you are looking for:

https://www.fourmoo.com/2017/11/21/power-bi-using-a-slicer-to-show-different-measures/

 

If this is not the case, please consider to provide the sample data from your first post as a dataset that we can reuse easily, e.g. upload an Excel file to onedrive or dropbox and share the link.

 

And also explain in more detail how you visual should look like.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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