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

Cumulative Total Measure doesnt consider duplicates

Hello,
I have 2 measures: 

 

Bruch (kg) = SUM('Unpivoted Bruch'[AnzahlBruch(kg)])

 

 

 

Cumulative Total = 
VAR cumulativbruch = [Bruch (kg)]
RETURN 
CALCULATE(  
    [Bruch (kg)],
    FILTER(
        ALLSELECTED('Unpivoted Bruch'[Material_Bruch]),
        [Bruch (kg)] >= cumulativbruch
    )
)

 

The second measure cumulatitve total should give the cumulated values of Bruch(kg). This works mostly, however it doesnt consider duplicates of Bruch(kg).

Example: Bruch(kg) = 100+50+50+20
Cumulativ total = 100+150+150+170

Hope someone can helpe me 🙂

5 REPLIES 5
VilmarSch
Post Patron
Post Patron

Seria bom que enviasse uma amostra dos seus dados. Pode ser fictícios.

 

Se for como este, terá que incluir um índice

 

 

Acc = 
CALCULATE (
    SUM ( Tabela[Valor] ),
    FILTER (
        ALL ( Tabela[Índice], Tabela[Coluna] ),
        [Índice] <= MAX ( Tabela[Índice] )
    )
)

 

 

Captura de tela 2023-06-14 200631.jpg

v-jingzhang
Community Support
Community Support

Hi @JANSAN 

 

Can you share some sample data of the table 'Unpivoted Brunch' along with some expected result based on that? Does column [Material_Bruch] have duplicated values?

 

Best Regards,
Community Support Team _ Jing

Unfortunaly I can not provide sample data. However yes [Material_Bruch] does have duplicates. Meaning in my data set, there are multiple AnzahlBruch(kg) which are associated with multiple [Material_bruch]. 

 

Bruch (kg) = SUM('Unpivoted Bruch'[AnzahlBruch(kg)])

 



Bruch[kg] is a SUM of multiple AnzahlBruch(kg) (data entries). 

Material_bruch is being used as a category to sort the Sum of data entries. 

Hope that helps!




pratyashasamal
Super User
Super User

Hi @JANSAN ,
Try this once :-

 

 

Cumulative Total = 
VAR cumulativbruch = [Bruch (kg)]
RETURN
    CALCULATE (
        [Bruch (kg)],
        [Bruch (kg)] >= cumulativbruch,
        ALL ( 'Unpivoted Bruch'[Material_Bruch] )
    )
)

 

Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Error : A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

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.

Top Solution Authors