Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mmontenegro
Regular Visitor

Columna de acumulado

Hello
I am trying to get the accumulated budget column, I have tried everything to make it dynamic since my budget has a fiscal year from June to May that is what I call a period, the fact is that I have managed to show them statically with this formula but no I manage to make it dynamic by selecting a month.

Measure:

mmontenegro_0-1663213043799.png

mmontenegro_0-1663211669091.png

 

The thing is that what I'm looking for is a dynamic accumulated as shown in the following image, when selecting, for example, the month of August, in the accumulated column it should return 3,333,590, otherwise it is returning the same result for the month, which is 770,122.

Same formula as above:

mmontenegro_1-1663212024130.png 

 

 
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @mmontenegro 
Please refer to attached file with the solution

In this case there are common slicers creating common outer filter context to two different visuals each having its own internal filter context. The best approach is to completely remove the "date" filter context and then build it in a way that serves both visuals. In order to do that I created a new column in the date table 

2.png

 

Orden YearMonth = Calendario[Orden año fiscal] * 100 + Calendario[Orden Mes Periodo]

 

The the following measure works for both visuals simultaneously 

 

Cumulative Real = 
VAR CurrentYear = MAX ( Calendario[Año Fiscal] )
VAR CurrentYearMonth = MAX ( Calendario[Orden YearMonth] )
VAR T1 = SUMMARIZE ( ALL ( Calendario ), Calendario[Año Fiscal], Calendario[Orden YearMonth] )
VAR T2 = FILTER ( T1, Calendario[Orden YearMonth] <= CurrentYearMonth && Calendario[Año Fiscal] = CurrentYear )
RETURN
    SUMX ( 
        T2, 
        VAR YeaMonth = [Orden YearMonth] 
        RETURN 
        CALCULATE([Real Mes], Calendario[Orden YearMonth] = YeaMonth, ALL ( Calendario ) )
    )

 

1.png

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @mmontenegro 
Please refer to attached file with the solution

In this case there are common slicers creating common outer filter context to two different visuals each having its own internal filter context. The best approach is to completely remove the "date" filter context and then build it in a way that serves both visuals. In order to do that I created a new column in the date table 

2.png

 

Orden YearMonth = Calendario[Orden año fiscal] * 100 + Calendario[Orden Mes Periodo]

 

The the following measure works for both visuals simultaneously 

 

Cumulative Real = 
VAR CurrentYear = MAX ( Calendario[Año Fiscal] )
VAR CurrentYearMonth = MAX ( Calendario[Orden YearMonth] )
VAR T1 = SUMMARIZE ( ALL ( Calendario ), Calendario[Año Fiscal], Calendario[Orden YearMonth] )
VAR T2 = FILTER ( T1, Calendario[Orden YearMonth] <= CurrentYearMonth && Calendario[Año Fiscal] = CurrentYear )
RETURN
    SUMX ( 
        T2, 
        VAR YeaMonth = [Orden YearMonth] 
        RETURN 
        CALCULATE([Real Mes], Calendario[Orden YearMonth] = YeaMonth, ALL ( Calendario ) )
    )

 

1.png

Hi @tamerj1 

 

It is incredible, I am very grateful, everything works according to what I was looking for.

mmontenegro_0-1663516042419.png

perform the same measurement with the accumulated budget and it works great!!

 

Thank you very much for the support @tamerj1 

mmontenegro
Regular Visitor

Hi @v-yueyunzh-msft 

 

please help, I attach my file, which contains all the data used, I have used your recommendation and I can not make it work.

 

https://cahsahon-my.sharepoint.com/:u:/g/personal/mmontenegro_cahsa_hn/ERBE4Xo7eVNAk1hzsAhxMfkBpPjKo...

v-yueyunzh-msft
Community Support
Community Support

Hi, @mmontenegro 

According to your description,when you write a measure that calculates the cumulative value, and then use the month to slice, "Total" is filtered, but you want to display the unfiltered sum. Right?

Here are the steps you can follow:

(1)This is my test data:

vyueyunzhmsft_0-1663310339438.png

 

(2) To simulate your measure, I created [Acumulado Real] :

 

Acumulado Real = CALCULATE( SUM('Table'[Real Mes]) , FILTER ( ALLSELECTED('Canlendar'[Date]) , 'Canlendar'[Date]<= MAX('Canlendar'[Date])))

 

vyueyunzhmsft_1-1663310339441.png

 

(3)We can create another to realize the replacement of “Total”:  “test”

 

test = IF( ISFILTERED('Table'[Master]) , [Acumulado Real] , CALCULATE([Acumulado Real] , ALL('Canlendar')))

 

 

(4)Then we can meet your need, the result is as follows :

vyueyunzhmsft_2-1663310339445.png

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors