cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
_chris_
Helper II
Helper II

Problem with Measure

Hi, I have a simple question I am struggling with:
 
I have two tables which have proper relationship. One is for time booking, the other is for the headers of the time bookings (ProjectPositions).
 
I am of the opinion, I did a proper measure:
 
PT = CALCULATE(SUMX(employeeHrs, employeeHrs[Hrs]/8), dimProjects[InvoicingKey]="nA", employeeHrs[toInvoice]=TRUE)
 
However, when I add the field Abrechnung (=InvoicingKey) to my table, the one ProjektPosId gets repeated with multiple invoicing keys while there is only one row in the database.
 
_chris__0-1675104441467.png_chris__1-1675104493548.png

It would be really nice if someone could help and explain to me what I am doing wrong.

 

Thx Christian

1 ACCEPTED SOLUTION
marcelsmaglhaes
Responsive Resident
Responsive Resident

Hey @_chris_ !

Try the measure below.

PT = 

CALCULATE(

SUMX(employeeHrsemployeeHrs[Hrs]/8), 
FILTER(dimProjects, dimProjects[InvoicingKey]="nA"),
FILTER( employeeHrs, employeeHrs
[toInvoice]=TRUE)
)

If this helps, please mark this question as solved to help people find quickly in our community!

Regards,
Marcel

View solution in original post

2 REPLIES 2
_chris_
Helper II
Helper II

Hi Marcel,

 

thanks a lot for your quick response. It works fine. I guess I have to go back and do my homeworks to understand why my solution did not work.

 

Thanks again!

 

Christian

marcelsmaglhaes
Responsive Resident
Responsive Resident

Hey @_chris_ !

Try the measure below.

PT = 

CALCULATE(

SUMX(employeeHrsemployeeHrs[Hrs]/8), 
FILTER(dimProjects, dimProjects[InvoicingKey]="nA"),
FILTER( employeeHrs, employeeHrs
[toInvoice]=TRUE)
)

If this helps, please mark this question as solved to help people find quickly in our community!

Regards,
Marcel

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!