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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Ley022
Frequent Visitor

dynamic graphic with calculated columns

Hi,

I want to generate a dynamic graph that changes from one calculated column to another, based on a filter. An example of calculated columns: IN1, IN2, IN3, IN4.

 

Imagen1.png

 

I want to generate a unique graphic that could show information from 20 different calculated columns, and I could select the calculated column of the graphic with a filter. 

Is there an easy way to do this?

 

Thanks in advance

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hello, @Ley022

It's a pleasure to answer for you.

According to its description, I think you can create a table (enter data) with a single column that includes all calculated column name elements, and then create a measure used in the 'values' of the stacked column chart.

Measure =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table (2)'[IN] ) = "IN1", MAX ( 'Table'[IN1] ),
    SELECTEDVALUE ( 'Table (2)'[IN] ) = "IN2", MAX ( 'Table'[IN2] ),
    SELECTEDVALUE ( 'Table (2)'[IN] ) = "IN3", MAX ( 'Table'[IN3] ),
    SELECTEDVALUE ( 'Table (2)'[IN] ) = "IN4", MAX ( 'Table'[IN4] ),
    SELECTEDVALUE ( 'Table (2)'[IN] ) = "IN5", MAX ( 'Table'[IN5] )
)
// max(your calculate column)  

Like this:2.png3.png

Here is my sample .pbix file. I hope it helps.

If you do not solve your problem, please feel free to ask me.

Best regards

Janey Guo

If this post helps,then consider Accepting it as the solution to help other members find it faster.

View solution in original post

3 REPLIES 3
v-janeyg-msft
Community Support
Community Support

Hello, @Ley022

It's a pleasure to answer for you.

According to its description, I think you can create a table (enter data) with a single column that includes all calculated column name elements, and then create a measure used in the 'values' of the stacked column chart.

Measure =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table (2)'[IN] ) = "IN1", MAX ( 'Table'[IN1] ),
    SELECTEDVALUE ( 'Table (2)'[IN] ) = "IN2", MAX ( 'Table'[IN2] ),
    SELECTEDVALUE ( 'Table (2)'[IN] ) = "IN3", MAX ( 'Table'[IN3] ),
    SELECTEDVALUE ( 'Table (2)'[IN] ) = "IN4", MAX ( 'Table'[IN4] ),
    SELECTEDVALUE ( 'Table (2)'[IN] ) = "IN5", MAX ( 'Table'[IN5] )
)
// max(your calculate column)  

Like this:2.png3.png

Here is my sample .pbix file. I hope it helps.

If you do not solve your problem, please feel free to ask me.

Best regards

Janey Guo

If this post helps,then consider Accepting it as the solution to help other members find it faster.

amitchandak
Super User
Super User

@Ley022 , check if measure slicer can help

https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slic...
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Great solution. I have achieved those results with table format when trying to create a graphic it does not work. Indeed filtering works properly in table, but when I change it to graphic visualization and add another variable (example, category) graphic does not work properly, and some categories of the axis are missing when it is filtered. Any idea? Thanks

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.