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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors