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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Problem with showing multiplying hours per pay rate.

Good day,

 

I'm quite new with Power BI, I'm having a small problem displaying the correct information.

 

I got a formula that works but for some reason when its one user its mulitplying something els.

For example.

 

CrystalHax_4-1642056830440.jpeg

 

With two users the Paid hours are showing the correct ammount of R5 250

But.

 

CrystalHax_5-1642056851865.jpeg

I have no idea where its getting the R132 000, It should be displaying the R5500

I suspect I need to add something on to the formula but unsure.

 

These are the two formulas I'm using.

 

"

Pay Measure 1 = SUM( 'Department Projects'[Hours] ) * SUM( 'Hourly Rate'[Hourly ] )
"
 
" Paid Hours =
IF (
HASONEVALUE ( 'Department Projects'[Employee ID] ),
[Pay Measure 1],
SUMX ( 'Department Projects', [Pay Measure 1])
)
"
 
Thank you.
Crystal
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

I tried it and the results is correct.(here have relationship by Employee ID)

then :

 

Pay Measure 1 = SUM('Department Projects'[Hours])*SUM('Hourly Rate'[Hourly ])
Measure 2 = IF(HASONEVALUE('Department Projects'[Employee ID]),[Pay Measure 1], SUMX('Department Projects',[Pay Measure 1]))

 

The final output is shown below:

vyalanwumsft_0-1642397338287.png

so you could check the different from yours and my data model,and the more details about your data.


Best Regards,
Community Support Team_ Yalan Wu
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

5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

I tried it and the results is correct.(here have relationship by Employee ID)

then :

 

Pay Measure 1 = SUM('Department Projects'[Hours])*SUM('Hourly Rate'[Hourly ])
Measure 2 = IF(HASONEVALUE('Department Projects'[Employee ID]),[Pay Measure 1], SUMX('Department Projects',[Pay Measure 1]))

 

The final output is shown below:

vyalanwumsft_0-1642397338287.png

so you could check the different from yours and my data model,and the more details about your data.


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , If these tables are related and hourly rate is on one side 

 

Pay Measure 1 = SUMX( 'Department Projects' ,'Department Projects'[Hours]  * related( 'Hourly Rate'[Hourly ] ) )

 

else try

sumx( values( 'Department Projects'[Employee ID] ), calculate( SUM( 'Department Projects'[Hours] ) * SUM( 'Hourly Rate'[Hourly ] )) )

Anonymous
Not applicable

Hi amitchandak,

 

Thanks for the reply.

 

The formula works but still having the same problem. I tried moving the hourly rate to.

 

 

@Anonymous ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Anonymous
Not applicable

 

I tried sharing the Pbix and the Excel file but can't

 

The Hourly Rate

 

Employee IDHourly SalaryDepartment Code
IA001R250R42 000RC001
IA002R250R42 000TS001
IA003R250R42 000AP001
IA004R250R42 000AP001
IA005R250R42 000RC001
IA006R250R42 000RC001
IA007R250R42 000AC001
IA008R250R42 000AC001
IA009R250R42 000AC001
IA010R250R42 000BD001
IA011R250R42 000AC001
IA012R250R42 000AP001
IA013R250R42 000DS001
IA014R250R42 000DS001
IA015R250R42 000OP001
IA016R250R42 000OP001
IA017R250R42 000AC001
IA018R250R42 000OP001
IA019R250R42 000TS001
IA020R250R42 000TS001
IA021R250R42 000TS001
IA022R250R42 000TS001
IA023R250R42 000TS001
IA024R250R42 000DS001

 

Department Projects with Hours

ProjectDescriptionDepartment CodeEmployee IDStart DateStart TimeEnd DateEnd TimeDuration (h)Hours
SCREEN CVSCREEN CVAC001IA0092022/01/1213:002022/01/1217:004:004:00
COLD CALLING / COMPANYCOLD CALLING / COMPANYAC001IA0092022/01/128:002022/01/1212:004:004:00
SCREEN CVSCREEN CVAC001IA0092022/01/1113:002022/01/1117:004:004:00
SCREEN CVSCREEN CVAC001IA0092022/01/1013:002022/01/1017:004:004:00
COLD CALLING / COMPANYCOLD CALLING / COMPANYAC001IA0092022/01/118:002022/01/1112:004:004:00
COLD CALLING / COMPANYCOLD CALLING / COMPANYAC001IA0092022/01/108:002022/01/1012:004:004:00
POWER BIPOWER BIDS001IA0242022/01/1213:002022/01/1217:004:004:00
POWER BIPOWER BIDS001IA0242022/01/128:002022/01/1212:004:004:00
POWER BIPOWER BIDS001IA0242022/01/119:002022/01/1116:007:007:00
POWER BIPOWER BIDS001IA0242022/01/109:002022/01/1016:007:007:00
INTERNAL ITINTERNAL ITDS001IA0242022/01/108:002022/01/109:001:001:01
FN-0002 TRAININGFN-0002 TRAININGDS001IA0142022/01/117:102022/01/1116:008:508:51
FN-0002 TRAININGFN-0002 TRAININGDS001IA0142022/01/109:002022/01/1016:007:007:01

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors