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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Liklikadze
Regular Visitor

Help/Can't Write Bonus system code

Im trying to write Bonus system code where Productoutinfo.Sacalo is just an number like price. If Productoutinfo.Sacalo is more then 500 it must write 0.01 * Productoutinfo.Sacalo. If its from 500 to 1000 it must write just 20 and above 1000 it must write 0.02 * Productoutinfo.Sacalo. i tryid every single combination with sums and calculate and without them. here's my code 
31.PNG

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Liklikadze , Try a measure like

 

measure =
var _sum = sum( Productoutinfo[Sacalo])
return
sumx( Table,
Switch(True() ,
_sum <= 500 , _sum *.01 ,
_sum <= 1000 , 20,
_sum *.02
)
)

 

Or use group by of visual in values 

measure =
var _sum = sum( Productoutinfo[Sacalo])
return
sumx( values(Table[column]) ,
Switch(True() ,
_sum <= 500 , _sum *.01 ,
_sum <= 1000 , 20,
_sum *.02
)
)

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Liklikadze , Try a measure like

 

measure =
var _sum = sum( Productoutinfo[Sacalo])
return
sumx( Table,
Switch(True() ,
_sum <= 500 , _sum *.01 ,
_sum <= 1000 , 20,
_sum *.02
)
)

 

Or use group by of visual in values 

measure =
var _sum = sum( Productoutinfo[Sacalo])
return
sumx( values(Table[column]) ,
Switch(True() ,
_sum <= 500 , _sum *.01 ,
_sum <= 1000 , 20,
_sum *.02
)
)

Someone give this man Power BI medal. Thanks a lot

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors