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
ThomasWeppler
Skilled Sharer
Skilled Sharer

Total should be the sum not a new calculation

Hi power bi community,

 

I want to calculate the employees bonus based on what each employee have sold. So I have made a measure to do so. But when I look at the total in my Matrix it doesn't look at the total of the bonus but instead calculate it as if all the employees was a single person and calculate the bonus based on that. Is their any workaround or is this just a quirk of Power BI?

1 ACCEPTED SOLUTION

Hi @ThomasWeppler ,

According to your description, I create a sample.

vkalyjmsft_0-1645757679329.png

 

My solution is directly create a calculated column.

Column =
VAR _faktura =
    SUMX (
        FILTER (
            ALL ( 'Invoice' ),
            'Invoice'[UserName] = EARLIER ( 'Invoice'[UserName] )
        ),
        Invoice[Faktureret]
    )
VAR _basic = 20000
VAR _normal = _basic + ( _faktura - _basic ) * 0.35
RETURN
    IF (
        _basic > _faktura,
        _basic,
        IF ( _normal > _faktura * 0.5, _normal, _faktura * 0.5 )
    ) * 0.5

Get the correct result.

vkalyjmsft_1-1645757887909.png

I attach the sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

4 REPLIES 4
ThomasWeppler
Skilled Sharer
Skilled Sharer

Thanks for your responses. Here is a bit more inf o

salary calculation.png


Unfortunatly I cannot just add the meassure into a calculation becuase the salaey depends of the total number of invoices send out by the employee. I hope it makes more sense now when I have given some additional context.

Hi @ThomasWeppler ,

According to your description, I create a sample.

vkalyjmsft_0-1645757679329.png

 

My solution is directly create a calculated column.

Column =
VAR _faktura =
    SUMX (
        FILTER (
            ALL ( 'Invoice' ),
            'Invoice'[UserName] = EARLIER ( 'Invoice'[UserName] )
        ),
        Invoice[Faktureret]
    )
VAR _basic = 20000
VAR _normal = _basic + ( _faktura - _basic ) * 0.35
RETURN
    IF (
        _basic > _faktura,
        _basic,
        IF ( _normal > _faktura * 0.5, _normal, _faktura * 0.5 )
    ) * 0.5

Get the correct result.

vkalyjmsft_1-1645757887909.png

I attach the sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

v-yanjiang-msft
Community Support
Community Support

Hi @ThomasWeppler ,

If you mean the measure works fine in each row but incorrect in the total, you should modify the formula of the measure, add SUM or SUMX in the formula. Or a simpler way, create a calculated column.

Column=[Measure]

Then put the column in the visual, it will calculate correctly in the total.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Pragati11
Super User
Super User

HI @ThomasWeppler ,

 

Please add more details to your query.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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