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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.