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
amartinezTower
Frequent Visitor

Sum of monthly accumulated

Good

I have a formula that sums up the accumulated data for one semester.

Total satos Acum6m =
VAR AcumuladoDatos=
CALCULATE([Total datos],DATESINPERIOD(TD_Calendario[Fecha],LASTDATE(TD_Calendario[Fecha]),-6,MONTH))
RETURN
IF ([Total Blows]<>BLANK(),Accumulated)

The problem is that the data appears correctly for months, but you needed the sum of the row to be those accumulated monthly. I actually get the same data as the last month shown in the table.

I understand why you're doing this, and I know I have to use another command, but I can't solve it.

I'd appreciate any help.

A greeting

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @amartinezTower ,

 

You may try to create a measure to replace the original one.

New Total satos Acum6m=

IF(HASONEVALUE('TABLE'[MONTH]),[Total satos Acum6m],CALCULATE(SUM([Total datos]),ALL('TABLE')))

 

The HASONEVALUE is to perform a calculation in the row of the matrix to get the result1, and perform another calculation in the Total row to get the result2.

屏幕截图 2020-12-02 150227.png

The word in your picture is in Spanish. I might misunderstand something wrong, please forgive me.

 

Reference: https://docs.microsoft.com/en-us/dax/hasonevalue-function-dax

 

Best Regards,

Stephen Tao

 

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

View solution in original post

6 REPLIES 6
amartinezTower
Frequent Visitor

In the end I solved the problem with:

Total Data Acum6m TOT=

SUMX ( DISTINCT (TD_Calendario[Year-Month]),[Total Data Acum6m] )

Thank you so much for all your help

v-stephen-msft
Community Support
Community Support

Hi @amartinezTower ,

Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.


Best Regards,
Stephen Tao

v-stephen-msft
Community Support
Community Support

Hi @amartinezTower ,

 

You may try to create a measure to replace the original one.

New Total satos Acum6m=

IF(HASONEVALUE('TABLE'[MONTH]),[Total satos Acum6m],CALCULATE(SUM([Total datos]),ALL('TABLE')))

 

The HASONEVALUE is to perform a calculation in the row of the matrix to get the result1, and perform another calculation in the Total row to get the result2.

屏幕截图 2020-12-02 150227.png

The word in your picture is in Spanish. I might misunderstand something wrong, please forgive me.

 

Reference: https://docs.microsoft.com/en-us/dax/hasonevalue-function-dax

 

Best Regards,

Stephen Tao

 

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

amitchandak
Super User
Super User

@amartinezTower , if you want to reset accumulative monthly. You need to use

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

 

If you selected accumulative 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[date])))

I don't understand the answer.

I have data accumulated per semester (6 months), but in the total of this data I want the sum. I currently have the same calculation as tenfo per month column

Debo haberme explicado mal. Te adjunto dos imagenes para entender el problema.

El total del acumulado me da 841.220, pero yo quiero la suma de los acumulados mostrados 8.178.279

 

Captura de pantalla 2020-11-30 130517.pngCaptura de pantalla 2020-11-30 130605 excel.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.