cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
YasirBilal
Helper I
Helper I

Show Badge According to Points

Hello Everyone

 

i have 2 table one table have different badge and 2nd table have Employee with value

 

Badge table

 

PointsBadge
100image link of badge 1
200image link of badge 2
300image link of badge 3
400image link of badge 4

 

badge table look like this 

 

Employee table

 

EmployeePoints
Employee1150
Employee2100
Employee3250
Employee4350
Employee5500

 

employee table look like this now when i create relationship between these 2 table one to one relationship create problem with one to one is only work when both table have unique value. badge image only show when unique value match like 100 points have level 1 image it's only showing when employee have same points what i want is from 1 to 100 level 1 bagde from 101 to 200 level 2 bagde and so on 

 

any idea how i can do that i try one to many and many to one relation but nothing change badge image not even show when i change relation to one to many or many to one with one to one i need unique value in both table but in employee table vlaue not same it's change everyday 

 

if anyone can help me this thank you

 

 

1 ACCEPTED SOLUTION
sreenathv
Super User
Super User

Add a calculated column with the following DAX code to your Employee table.

 

BadgePoints = 
VAR P = Employee[Points]
VAR Result =
    SWITCH(
        TRUE(),
        P>=100 && P<200,100,
        P>=200 && P<300,200,
        P>=300 && P<400,300,
        P>=400,400,
        0)
RETURN
Result

This will give you the following result.

sreenathv_0-1618218034739.png

Then create the relationship between this new calculated column and your Badge table.

View solution in original post

2 REPLIES 2
sreenathv
Super User
Super User

Add a calculated column with the following DAX code to your Employee table.

 

BadgePoints = 
VAR P = Employee[Points]
VAR Result =
    SWITCH(
        TRUE(),
        P>=100 && P<200,100,
        P>=200 && P<300,200,
        P>=300 && P<400,300,
        P>=400,400,
        0)
RETURN
Result

This will give you the following result.

sreenathv_0-1618218034739.png

Then create the relationship between this new calculated column and your Badge table.

View solution in original post

thank you

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.