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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
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.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

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

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.