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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nj-matt
Helper I
Helper I

Add column to identify group by data range

I have 2 tables - promotions and ROI ranges.

 

I would like to identify the promotions by the range in the ROI range table.

 

promo_groups

 

Promotion IDROI
A12341.50
A12351.25
A12361.05
A12370.88

 

ROI Performer Ranges

 

Promo TypeMinMax
Higher Performer1.402.00
Average Performer1.201.40
Low Performer1.001.20
Non Performer0.001.00

 

I want to add a column to my promo_groups table to now look like this -->

 

Promo IDROIPromo Type
A12341.50High Performer
A12351.25Average Performer
A12361.05Low Performer
A12370.88Non Performer

 

What is the formula to bring in this new colum to the promo_groups table?

1 ACCEPTED SOLUTION
AlB
Super User
Super User

@nj-matt 

Calculated column for your Table1:

 

Promo Type =
CALCULATE (
    DISTINCT ( Table2[Promo Type] ),
    FILTER ( Table2, Table2[Min] <= Table1[IDROI] && Table2[Max] > Table1[IDROI] )
)

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

 

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

@nj-matt 

Calculated column for your Table1:

 

Promo Type =
CALCULATE (
    DISTINCT ( Table2[Promo Type] ),
    FILTER ( Table2, Table2[Min] <= Table1[IDROI] && Table2[Max] > Table1[IDROI] )
)

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

 

That did it - thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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