cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
maxvdwerf Frequent Visitor
Frequent Visitor

Wrong row totals

Hi all,

 

I'm looking for some help getting the right row totals. The situation: Employees in our company have to register their worked hours in the booking system. Details about which company they work for are available in the HRM system, for that reason I had to map them in "MASTER - Employees". Last year a lot of employees switched from Company A to Company B, for that employees Power BI calculates the wrong row total.

Below is an example of one employee who switched from Company A to Company B in March 2018.

 

Screenshot 1.jpg

 

Relationship between the tables:

Schema.PNG

 

And the measure I used so far:

Test = 
CALCULATE(
    DIVIDE(SUM('FACT - Entries'[Tijd in minuten]);60;BLANK());
    FILTER(
        'FACT - Employment Records';
        'FACT - Employment Records'[Start Date] <= MAX('DIM - Calendar'[Datum])
        && 'FACT - Employment Records'[End Date] >= MIN('DIM - Calendar'[Datum])
    )
)

Who can help me to solve this problem? Many thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
maxvdwerf Frequent Visitor
Frequent Visitor

Re: Wrong row totals

Hi @v-shex-msft,

 

Thank you for your reply. The solution was to create an extra measure:

 

Measure2 = SUMX(VALUES('DIM - Calendar'[Datum]);[Test])

 

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Wrong row totals

Hi @maxvdwerf ,

I think you need to add if statement to check current row contents level and write a specific calculation formula with conditions based on current category fields, it will help measure to group calculation result by current category.

Measure Totals, The Final Word

If you still confused on coding formula, please share some sample data for test.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
maxvdwerf Frequent Visitor
Frequent Visitor

Re: Wrong row totals

Hi @v-shex-msft,

 

Thank you for your reply. The solution was to create an extra measure:

 

Measure2 = SUMX(VALUES('DIM - Calendar'[Datum]);[Test])

 

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 129 members 1,671 guests
Please welcome our newest community members: