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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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