cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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 Value MOQ Weeks 100 6 200 7 400 10 200 16 100 52

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
Community Support

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.
3 REPLIES 3
Community Support

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.
Regular Visitor

@v-chuncz-msft

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?

Community Support

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.

Announcements

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

New forum boards available in Real-Time Intelligence.

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

Top Solution Authors
Top Kudoed Authors