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
Anonymous
Not applicable

Can I accumulate a measure?

I created a measure in which i calculated an indicator and now i want that indicator to be accumulated. 

2 ACCEPTED SOLUTIONS
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Refer:

Measure = SUMX(FILTER(ALLSELECTED('Table'),'Table'[yearmonth]<=MAX('Table'[yearmonth])),[ind_rotacion])

 

Best Regards,

Jay

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

View solution in original post

Hey @Anonymous ,

 

I think an approach like the following should work:

ind_rotacion_TD =
VAR rota_colab =
    CALCULATE (
        SUM ( ROTACION[ROTACION] ),
        DATESBETWEEN (
            myDateTable,
            FIRSTDATE ( ALL ( myDateTable[Date] ) ),
            LASTDATE ( myDateTable[Date] )
        )
    )
VAR totalcolaborador =
    CALCULATE (
        COUNT ( 'BD Consolidado'[Contrato] ),
        DATESBETWEEN (
            myDateTable,
            FIRSTDATE ( ALL ( myDateTable[Date] ) ),
            LASTDATE ( myDateTable[Date] )
        )
    )
RETURN
    DIVIDE ( rota_colab, totalcolaborador )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

8 REPLIES 8
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Refer:

Measure = SUMX(FILTER(ALLSELECTED('Table'),'Table'[yearmonth]<=MAX('Table'[yearmonth])),[ind_rotacion])

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

Thank you so much for your reply jay,

when i used this solution the result i get is the accumulative sum of the rotation, even when i am summing the measure ind_rotation 

Syndicate_Admin
Administrator
Administrator

Hello guyes,

I´ve the same probleam as @steveruiz...
Thank you in advanced

BA_Pete
Super User
Super User

@Anonymous ,

 

I presume you mean accumulated over time, in which case you can use functions like DATESYTD, TOTALYTD as long as you've got a correctly set-up calendar table.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




selimovd
Super User
Super User

Hey @Anonymous ,

 

can you give more details?

Accumulated by what? By time? By year? By product?

 

Best regards

Denis

Anonymous
Not applicable

Hey Denis (@selimovd),

 

Thank you for your time, I'm acummulating by time it's a monthly indicator and i have the date, and a colum for the month and year! 

This is the measure i'm using and i need to acummulate the result it gives me :

ind_rotacion =
VAR rota_colab =
SUM(ROTACION[ROTACION])
VAR totalcolaborador=
COUNT('BD Consolidado'[Contrato])
RETURN
DIVIDE(rota_colab,totalcolaborador)
 
rotacion.png

Hey @Anonymous ,

 

I think an approach like the following should work:

ind_rotacion_TD =
VAR rota_colab =
    CALCULATE (
        SUM ( ROTACION[ROTACION] ),
        DATESBETWEEN (
            myDateTable,
            FIRSTDATE ( ALL ( myDateTable[Date] ) ),
            LASTDATE ( myDateTable[Date] )
        )
    )
VAR totalcolaborador =
    CALCULATE (
        COUNT ( 'BD Consolidado'[Contrato] ),
        DATESBETWEEN (
            myDateTable,
            FIRSTDATE ( ALL ( myDateTable[Date] ) ),
            LASTDATE ( myDateTable[Date] )
        )
    )
RETURN
    DIVIDE ( rota_colab, totalcolaborador )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
Anonymous
Not applicable

Thank you so much for your answer,

When i used your solution i did not get the correct result. Attached you may find a table with a column in green with the result i need and in yellow with the result i'm getting

tabla rotacion.png

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.