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
SNik
Helper I
Helper I

Adding Relations

Hi

I have 2 tables

tblSales ([ProductID] , [Price$])

                   1                250

                   2                400

                   3              1800

you get the idea

 

tblSalesBracket ([Price$] , [BandRange])

                              1          [Less Than 100]

                              2          [Less Than 100]

                               .                  .

                               .                  .

                             498        [400 - 500]

                             499        [400 - 500]

                             500        [Over 500]

 

As you can see i can not use relation for the [Price$] field between the 2 tables becasue the tblSalesBracket ends at 500 but in the tblSales i have more that 500

 

how can i add a relate the 2 fields together, i assume i need to use DAX

and what happens when i use decimals in the tblSales only what would be the solution

Thanks

Sincerely
Nik- Shahriar Nikkhah
1 REPLY 1
Mi2n
Employee
Employee

You might not need the second table at all. You can create a calculated column in the 1st table, and use the If function to sort out the Price data into the various buckets.

 

So, the calculated column would go something like,

 

Column = IF(tblSales[Price$]<100, "Less than 100", IF(tblSales[Price$]<200,"100-200",... so on))

You get the idea.

 

Regards,

Mi2n

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.

Top Kudoed Authors