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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
dixon1983
Regular Visitor

Cumulative measure with criteria

Hi,

I'd like to create an area chart with weeks on the X Axis and Value on the Y Axis.

 

The Value needs to be cumulative, for example

 

MOQ ValueMOQ Weeks
1006
2007
40010
20016
10052

 

Week 1 on the chart should show the total of MOQ Weeks > 1

Week 2 on the chart > 2

etc

 

I'm at a loss on how to do this and after reading numerous posts have given up.

 

I'd greatly appreciate if someone could help.

 

Thanks.

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

@dixon1983,

 

You may refer to the measure below.

Measure =
VAR w =
    SELECTEDVALUE ( Table1[MOQ Weeks] )
RETURN
    SUMX ( FILTER ( ALL ( Table1 ), Table1[MOQ Weeks] > w ), Table1[MOQ Value] )
Community Support Team _ Sam Zha
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

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@dixon1983,

 

You may refer to the measure below.

Measure =
VAR w =
    SELECTEDVALUE ( Table1[MOQ Weeks] )
RETURN
    SUMX ( FILTER ( ALL ( Table1 ), Table1[MOQ Weeks] > w ), Table1[MOQ Value] )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@v-chuncz-msft

 

 

Many thanks for the reply.

 

The measure works great apart from where the MOQ Weeks has zero count.

For example no part numbers have an MOQ weeks of 47. So instead of still summing MOQ Value for MOQ Weeks > 47 the measure would sum MOQ Value for MOQ Weeks > 0. This causes big spikes in the Area Chart.

 

Is there a way to Auto Filter these out? Or to amend the measure?

 

Thanks in advance.

@dixon1983,

 

You may simply add an IF Function.

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.