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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Standef
Helper I
Helper I

DAX table with dynamic values based on measures

Hello everyone,

 

I am trying to have a table written in dax, with MIN and MAX values of a measure.

I have a measure that varies based on several slicers; I woul dlike to have a table that automatically creates 4 clusters based on this measure. 

I have built a table with 4 columns (id, Segment, Min, Max) like so : 

 

table_cluster =
var boundary1 =   calculate(MAXX(ALL('Store-Country Map'[STORE_ID]),[MY_MEASURE]))
var boundary2 =   (bounder1 / 4 ) *3
var boundary3 =   (bounder1 / 4 ) *2
var boundary4 =   bounder1 / 4
var boundary5 =   calculate(MINX(ALL('Store-Country Map'[STORE_ID]),[MY_MEASURE]))

return
    {
    (1,"Major",     boundary2, boundary1),
    (2,"important", boundary3, boundary2),
    (3,"mid",       boundary4, boundary3),
    (4,"low",       boundary5, boundary4)
}

 

And it doesn't work as it seems that the table cannot accept a measure for the values. 

As soon as I replace the table's code by hard coded values, it works.

 

Any help would be much appreciated!
Thanks,
Stan

 

5 REPLIES 5
lbendlin
Super User
Super User

You should not create calculated columns from measures. You cannot create calculated tables from measures (unless it is a single row single column table).  In both cases your measure will use a non-existent filter context.

 

The maximum you can do is create a table variable as an intermediate step in a measure definition.

Thanks @lbendlin ! How would I create such table variable ? 

Measure a =
Var b= summarize (c,[d])
Return countrows(b)

Summarize is not able to be dynamic, even built with a measure unfortunately. 
Thanks anyway!

That's news to me. Please try it out.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.