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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
as-nons-kk
New Member

dynamic column references

Hi, I have a table of 21 columns {id, metrics 1, metrics 2, ..., metrics 20}. I want to have 2 slicers in PBI report to select 2 metrics, then dynamically calculate min, max, and median in a table. Now I face the difficulty as DAX does not support dynamic column references directly. Any suggestion on this?

2 REPLIES 2
Anonymous
Not applicable

HI @as-nons-kk,

Perhaps you can take a look at the calculate group and field parameter features if they help with your scenario:

Create calculation groups in Power BI (preview) - Power BI | Microsoft Learn

Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn

Regards,

Xiaoxin Sheng

shafiz_p
Super User
Super User

@as-nons-kk From what I understand, you’d like the minimum, maximum, and median values to adjust dynamically based on slicer selections. For instance, when you choose ‘Metric 1,’ your table should display results specific to that ‘Metric 1’ column. To achieve this, consider unpivoting the ‘Metrics 1’ through ‘Metrics 20’ columns in your table using Power Query. This transformation will convert them into rows, simplifying dynamic referencing. Next, calculate the min, median, and max values based on the value column of unpivoted table and incorporate them into your table.

 

I hope this explanation helps! If it addressed your question, feel free to mark it as the solution!😊

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.