cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
chris_k
Helper I
Helper I

Cumulative count for graph

Hello,

 

I am trying to produce a cumulative count for my data, I've attempted to use a method that I see frequently in the forums but cannot seem to get it to work.

 

See screen shot attached with attempted DAX formula, and the graph it outputs (which is clearly not cumulative).

 

cumulative = CALCULATE (COUNTROWS('Asta Outputs - Task'), FILTER (ALLSELECTED('Asta Outputs - Task'), 'Asta Outputs - Task'[StartDate] <= MAX('Asta Outputs - Task'[StartDate])))

So Im attampting to create a count of rows building up by date.

 

Any help would be appricated.

 

Attempt at Cumulative Count.PNG

Graph.PNG

1 ACCEPTED SOLUTION

Hi @chris_k,

 

I think the issue may related to the NOT(ISBLANK('Asta Outputs - Task'[ActualStart])), perhaps you can try to move the blank filter into filter function.

 

Cumulative Tasks Actually Started = CALCULATE (COUNTROWS('Asta Outputs - Task'), FILTER (ALLSELECTED('Asta Outputs - Task'), 'Asta Outputs - Task'[ActualStart] <= MAX('Asta Outputs - Task'[ActualStart])&&[ActualStart]<>BLANK()))

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
chris_k
Helper I
Helper I

I initally solved this issue, and now Ive made it far more complicated.

 

I essentially have a table with two dates in it: StartDate and ActualStart. Every row has a StartDate but the ActualStart can be blank so I adapted the formula to ignore blanks. 

 

My adaptatons work perfectly if I put them in indiviual graphs but I need to overlay them on on graph. Using either date as the X axis breaks the other count (Because I think it ignores dates and just counts values)

 

Attached are the Measures and some images of the current broken graph. 

 

As you see in the data the line Cumulative Tasks Actually Started shouldnt stay flat? But tasks planned to start is perfect. If i change the X axis to ActualStart then it reverses with Actually Started working but Start Date broken.

 

Cumulative Tasks Planned To Start = CALCULATE (COUNTROWS('Asta Outputs - Task'), FILTER (ALLSELECTED('Asta Outputs - Task'), 'Asta Outputs - Task'[StartDate] <= MAX('Asta Outputs - Task'[StartDate])))
Cumulative Tasks Actually Started = CALCULATE (COUNTROWS('Asta Outputs - Task'), FILTER (ALLSELECTED('Asta Outputs - Task'), 'Asta Outputs - Task'[ActualStart] <= MAX('Asta Outputs - Task'[ActualStart])), NOT(ISBLANK('Asta Outputs - Task'[ActualStart])))

Dates Extract.PNGGraph.PNG

Thanks,

Hi @chris_k,

 

I think the issue may related to the NOT(ISBLANK('Asta Outputs - Task'[ActualStart])), perhaps you can try to move the blank filter into filter function.

 

Cumulative Tasks Actually Started = CALCULATE (COUNTROWS('Asta Outputs - Task'), FILTER (ALLSELECTED('Asta Outputs - Task'), 'Asta Outputs - Task'[ActualStart] <= MAX('Asta Outputs - Task'[ActualStart])&&[ActualStart]<>BLANK()))

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @chris_k,

 

Please use measure to instead the calculate column, current power bi not support dynamic calculated column based on slicer or filter.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
vanessafvg
Super User
Super User

@chris_k i think the issue here is that you need to create a date table, have you done that and then link the date to the date table





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors