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
Tumbleweed
Helper II
Helper II

Totals in calculating weekly pay measure

My friends,

 

I'm calculating weekly hours and pay. Totals for hours measure are correct. However, I'm having difficult time with the pay. No matter what I do it doesn't get fixed. I tried summarize, hasonevalue, if functions to no avail.

Tumbleweed_0-1660470375003.png

 

Maybe you can help me to correct it?

 

https://drive.google.com/file/d/13ietQWO6sakcoyIdVVLanIWRuHvoLhuA/view?usp=sharing

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @Tumbleweed 

try this measure instead:

Tom = 
SUMX(
    'Hours Per Week 1'
    , 'Hours Per Week 1'[ot1] * 'Hours Per Week 1'[OT Pay]
)

This allows creating this matrix visual:
image.png

Using the table iterator function SUMX ensures that the sum of the product of quantity and price is calculated. Otherwise, the product of sums will be calculated.

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

6 REPLIES 6
TomMartens
Super User
Super User

Hey @Tumbleweed 

try this measure instead:

Tom = 
SUMX(
    'Hours Per Week 1'
    , 'Hours Per Week 1'[ot1] * 'Hours Per Week 1'[OT Pay]
)

This allows creating this matrix visual:
image.png

Using the table iterator function SUMX ensures that the sum of the product of quantity and price is calculated. Otherwise, the product of sums will be calculated.

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi Tom, It did work!!! Thank you so much! 

I have one more question if you don't mind: I need to show hour length in a slicer. I used the following DAX

that doesn't have any affect on the matrix. How I can create interactive measure/CC for the slicer? Thank you

Weekly OT Length =
SWITCH(
TRUE(),
'Table'[Measure Weekly OT Hours]< 2, "< 2 Hours",
'Table'[Measure Weekly OT Hours] >2, ">= 2 Hours")

Tumbleweed_0-1660515307891.png

 

Hi,

Share the link from where i can download your PBI file with the correct measures already written in there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you

Hi,

There are formulas there which i do not agree with.  The hours per week 1 table is a calculated table and i do not see the reason why that should be a calculated table.  The OT1 column does not need a CALCULATE() function.  A lot of work to be done here.  May be you should wait for someone else to contribute who can help you with the way the tables are already there in your existing model.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

Thank you so much for your feedback. I do appreciate it.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.