cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AW1976NOVA
Post Patron
Post Patron

How to create a new table based on the min and max values of a column

Hi,

 

I'd like to create a new table based on the min and max values within a column.  Here is an example of the table:

 

Car               Color       Motor     HP

911               Red         2.6          330

Mustang       Blue        5.0          430

Trans Am      White     6.6          475

Dart              Brown     4.2         200

 

I'd want to use the HP column's MIN and MAX value to create a new table with those as the tables limits.

 

Can you assist me in the DAX I'd need to accomplish this?

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

How about using GENERATESERIES?

 

HP_Table =
GENERATESERIES ( MIN ( Table1[HP] ), MAX ( Table1[HP] ), 5 )

This produces a table with one column [Value], {200, 205, ..., 470, 475}.

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

How about using GENERATESERIES?

 

HP_Table =
GENERATESERIES ( MIN ( Table1[HP] ), MAX ( Table1[HP] ), 5 )

This produces a table with one column [Value], {200, 205, ..., 470, 475}.

Hey AlexisOlson, if our Max and Minimum values change, shouldnt the table change as well? for Example if I have a slicer which effectively changes minimum and maximum value, the column returned should also change right?

No. A calculated table cannot be dynamically responsive to filters since calculated tables are only computed when the dataset is initially loaded or refreshed rather than in response to user interactions via filters or slicers.

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors