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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
RK91
Frequent Visitor

cumulative sum

Hi,

 

I'm looking to create a measure that sums up the total YTD "comparison" per supplier, material and category.

so far I got it to work on supplier level but from material level up results are off.

link to PBIX: https://we.tl/t-LzZmHP4ldl

 

expected results:

  • A category, A material, A for supplier = -14,72K (works)
  • A category B material, A for suppier = -26,05K (works)
  • A category, B material, B for supplier = 21,89K (works)
  • A category, B material A & B for suppier = -4,16
  • A category, A material & B material = -18,88K

 

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi @RK91  , 

 

You could create a measure by the following formula:

cumulative2 =
VAR _A =
    CALCULATE ( [cumulative], 'Material'[Supplier] = " A" )
VAR _B =
    CALCULATE ( [cumulative], 'Material'[Supplier] = " B" )
VAR _COUNT =
    DISTINCTCOUNT ( 'Material'[Supplier] )
RETURN
    IF (
        _COUNT = 1
            && MAX ( [Supplier] ) = " A",
        _A,
        IF ( _COUNT = 1 && MAX ( [Supplier] ) = " B", _B, _A + _B )
    )

The final output is shown below:

v-yalanwu-msft_2-1620727227700.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.  

hi @v-yalanwu-msft, thank you for reaching out. I thought I already replied but didn't - sorry.

 

Although it works on material level it doesn't give the expected result for the category. Also I have a lot more suppliers, materials and categories in my actual data and therfor I think it's not a sustainable solution in this case.

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.