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
Anonymous
Not applicable

Cumulative total with legend

Hi,

 

I am new to power bi, i am trying to find out the cumulative total for counts.

I have versions for legend:  e.g. osd 3, osd 4, osd 5

The following measure i used for finding cumulative total.

Cumulative total of different version =
CALCULATE(
COUNTA(dummy_data[version]),
ALL(dummy_data),
FILTER(ALLSELECTED(dummy_data[date_installed]),dummy_data[date_installed]<= MAX(dummy_data[date_installed])),VALUES(dummy_data[version])
)
 
This is what i got using the measure, however it will not show any data if that month do not have the data.
I want it to have constant line instead of dots even if the next month has no data, it should take from previous month.
 
 
 
Graph.PNG
Any help would be greatly appreciated.
Thank you in advance.
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Typically this is how we get a cumulative date with a date table

Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-12,MONTH)) 
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],MAX(Sales[Sales Date]),-12,MONTH))  

Legend should create different cumulative lines

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Please modify the measure using dax like pattern below and check if this issue persists:

Cumulative total of different version =
CALCULATE (
    DISTINCTCOUNT ( dummy_data[version] ),
    FILTER (
        ALLSELECTED ( dummy_data ),
        dummy_data[date_installed] <= MAX ( dummy_data[date_installed] )
    )
)

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

Typically this is how we get a cumulative date with a date table

Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-12,MONTH)) 
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],MAX(Sales[Sales Date]),-12,MONTH))  

Legend should create different cumulative lines

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

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.