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
Antonio_Gomez
Resolver I
Resolver I

Error in the amount of the rows

 

Hello everyone, hoping all of you having a great day.

 

I need some help with this issue:

 

My totals are OK. But, the amount shown in the rows is not right.

 

Antonio_Gomez_0-1649406818891.png

 

The relationship of the tables is:

 

Antonio_Gomez_1-1649407040645.png

 

Where:

  • "Empleado" is the table of the staff. So, every line is a employee. The link column is "EmpleadoId".
    EmpleadoIdCodigoPracticoName
    1021Employee 1
    2057Employee 2
    3013Employee 3
  • "EstadoMovimiento" is a table of the movement of transportation. A transport passes through different states. So, this table has in every line a diferent state for the several transport. For each diferent state (every row) I have an employee assigned to it, because this worker made the move. Then, I can have for one movement "MovimientoId" several states "TipoEstadoId" and the same employee "EmpleadoId" related to it. Like:
    MovimientoIdTipoEstadoIdEmpleadoId
    1215
    1415
    1615
  • "Movimiento" is the table of the movements and is linked to "EstadoMovimiento" by "MovimientoId" 
    MovimientoIdOther columns
    1 
    2 
    3 

     

    The first image is a matrix with:
  • Rows: CodigoPractico
  • Columns: The years related to the movements
  • Values: A measure Movement = CALCULATE(COUNT(Movimiento[MovimientoId])))

 

I don't why for the calculation of the rows PBI is like doubling the employees. Maybe is because of the table "EstadoMovimiento" like in this I have for the same movement "MovimientoId" several times the same employee "EmpleadoId".

 

I really need some help with this.

 

Thanking you in advance for your help.

 

Greeting,

 

Antonio

 

 

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @Antonio_Gomez ,

 

Sorry for that the information you have provided is not making the problem clear to me.

Please provide me with more details about your table and your expected outputor share me with your pbix file after removing sensitive data.

 

You may refer to:

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

How to Get Your Question Answered Quickly - Microsoft Power BI Community

 

Best Regards,
Eyelyn Qin

Hello @v-eqin-msft 

 

Thanks for the response, I was cleaning my data in order to send you my pbix and I could see the problem but I don't know how to fix it.

 

When in the table "EstadoMovimiento" two or more employees make one move, the PBI counts each employee as different movement but actually is the same movement.

 

For example, this happen in the "EstadoMovimiento" table. You can see that the movement 2 was made by the employees 17 and 15. In my case, the PBI shows a total of 2 movements but in the rows it would show 3.

 

MovimientoIdTipoEstadoIdEmpleadoId
1215
1415
1615
2217
2415
2615

 

By the other hand, I was looking how to send you my pbix. But, i don't know how to do it. So I put reduced data in the following tables:

 

You can see that the movement 840 was made by the employees 17 and 14.

 

This is the PBI table result. The total of movements is OK as it is 25. But, if you sum 5+7+2+6+2+3+1 is equal to 26.

 

I need a formula that the movement be assigned to one of the two employees. Because, the 

CantMov = count(Movimiento[MovimientoId]) doesn't work for me

Antonio_Gomez_0-1650460643151.png

Antonio_Gomez_1-1650461028413.png

 

 

 

 

Empleado's Table

EmpleadoIdNombre CompletoActivoCodigoPracticoUsuarioId
17Employee Name 17False01917
31Employee Name 31True02231
49Employee Name 49True 49
23Employee Name 23False00123
30Employee Name 30True02130
14Employee Name 14True01714
55Employee Name 55True02555

 

 

EstadoMovimiento's Table

EstadoMovimientoIdTipoEstadoIdMovimientoIdEmpleadoId
1384017
22384017
3284014
4484014
5384117
62384117
7284117
8484117
9384217
102384217
11284217
12484217
13384331
142384331
15284331
16484331
17384414
182384414
19284414
20484414
21384517
222384517
23284517
24484517
25384630
262384630
27284630
28484630
29384730
302384730
31284730
32484730
33384830
342384830
35284830
36484830
37384930
382384930
39284930
40484930
41385030
422385030
43285030
44485030
45385114
462385114
47285114
48485114
49385217
502385217
51285217
52485217
53385331
542385331
55285331
56485331
57385430
582385430
59285430
60485430
61385549
622385549
63285549
64485549
65385649
662385649
67285649
68485649
69385717
702385717
71285717
72485717
73385814
742385814
75285814
76485814
77385914
782385914
79285914
80485914
81386017
822386017
83286017
84486017
85386123
862386123
87286123
88486123
89386223
902386223
91286223
92486223
93386349
942386349
95286349
96486349
97386455
982386455
99286455
100486455

 

 

Movimiento's Table

 

MovimientoIdFechaBuqueId
840sábado, 1 de enero de 202255
841sábado, 1 de enero de 202275
842sábado, 1 de enero de 202233
843sábado, 1 de enero de 202228
844sábado, 1 de enero de 20223
845sábado, 1 de enero de 2022105
846sábado, 1 de enero de 2022303
847sábado, 1 de enero de 202299
848sábado, 1 de enero de 2022107
849sábado, 1 de enero de 202287
850lunes, 3 de enero de 202241
851lunes, 3 de enero de 202217
852lunes, 3 de enero de 202215
853lunes, 3 de enero de 202266
854lunes, 3 de enero de 2022211
855lunes, 3 de enero de 2022157
856lunes, 3 de enero de 2022113
857lunes, 3 de enero de 2022155
858lunes, 3 de enero de 202271
859lunes, 3 de enero de 2022145
860lunes, 3 de enero de 2022181
861martes, 4 de enero de 2022151
862martes, 4 de enero de 2022204
863martes, 4 de enero de 2022199
864martes, 4 de enero de 20224

 

 

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.