Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
3 years ago

cumulative by column

Good morning

I have a table that I indicate below:

1 trim
abs causesabs hoursAccumulated by columnsaccumulated by column to exit
Tests1520764.375134.1
enf/fall020764.375134.1
marriage198.4220764.375134.1
acc862.520764.375134.1
ENF with low3487.520764.375134.1
ENF without low195.320764.375134.1
Move home3020764.375134.1
Cons. doctor336.920764.375134.1
Inex duty8.7520764.375134.1
nursing020764.375134.1
5134.1

20764.37

5134.1

And the column "accumulated by columns" gives me the accumulated in the year with filters applied with segmenters and what I want is that of the total of the column of ABS hours for the quarter as I indicate in the column "accumulated by column that must come out"

The formula I have is:

CUMULATIVE HOURS OF ABSENTEEISM BY CAUSAS_FILAS =
CALCULATE ([ABS HOURS],
ALLSELECTED('ABSENTEEISM ROWS')
)
Thanks a lot

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Syndicate_Admin ,

    I created some data:

    Added a row for quarters

    Here are the steps you can follow:

    1. Create calculated column.

     

    If you don't group it, you can accumulate it directly through Index

    Column =
    SUMX(
        FILTER(ALL('ABSENTEEISM ROWS'),
        'ABSENTEEISM ROWS'[Index]<=EARLIER('ABSENTEEISM ROWS'[Index]))
        ,[abs hours])

     

    If you want to group by quarter, you can use EARLIER and Index to accumulate

    Column 2 =
    SUMX(
        FILTER(ALL('ABSENTEEISM ROWS'),
        'ABSENTEEISM ROWS'[Index]<=EARLIER('ABSENTEEISM ROWS'[Index])&&'ABSENTEEISM ROWS'[quarter]=EARLIER('ABSENTEEISM ROWS'[quarter]))
        ,[abs hours])

    2. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • I think I expressed the problem wrong, the table I indicate is the display table and what I want in the display table is to have the ABS hours by causes and by quarter, so far I have achieved it. What gives me problems is to make a measure so that I get the total hours of absenteeism per quarter without differentiating the causes, that is to say that when putting the measure in the visualization in each cause I got the 5134, 10 to get the percentage. And the measure I have is:

    CUMULATIVE HOURS OF ABSENTEEISM BY CAUSAS_FILAS =
    CALCULATE ([ABS HOURS],
    ALLSELECTED('ABSENTEEISM')) but this measure divides me the 5134.1 its propocionalidad in each cause that is not what I want.