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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
)
)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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
)
)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Someone give this man Power BI medal. Thanks a lot

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors