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
harib
Post Patron
Post Patron

How to display year end wise running total with measure

Hi 

 

I Would like to display Running total like below .

 

Year             MJ_Values       Runnning Total

2017-11       10                    10

2017-12       10                    20

2018-01       05                    05

2018-01        20                   25

2018-01       05                    30

2019-01       06                    06

2019-02       10                    16

 

Running  Total should be end at every year end and it has to start at the new year beginings.

 

Measure i have used to get MJ Values

MJ Values = CALCULATE(sumX('Table',If( 'Table'[KPI]="RPN" && ('Table'[SEVERITY]) ="Major" ,1,0)))
 
If anyone knows please let me know 
 
Thanks in Advance
1 ACCEPTED SOLUTION

Try Like.

Critial YTD = CALCULATE([Critical],FILTER('Date','Date'[Date]<=maxx('Date',ENDOFYEAR('Date'[Date])))) 

View solution in original post

6 REPLIES 6
v-shex-msft
Community Support
Community Support

HI @harib,

I'd like to suggest you use date function to manly define filter range instead use time intelligence functions.

Time Intelligence "The Hard Way" (TITHW)  

Running total =
VAR currDate =
    MAX ( Table[Date] )
RETURN
    CALCULATE (
        SUM ( Table[MJ_Values] ),
        FILTER (
            ALLSELECTED ( Table ),
            [Date] < currDate
                && YEAR ( Table[Date] ) = YEAR ( currDate )
        )
    )

If your field not stored valid date value, you can try to convert them to date in your expression before calculate.

Regards,

Xiaoxin Sheng

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

In case you have date column, then create a calendar and join the date with it. then you can use formulas like datesytd, totalytd

YTD Sales = CALCULATE(SUM(table[MJ Values]),DATESYTD(('Date'[Date]),"12/31"))

 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/

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

@amitchandak 

 

YTD function not showing running total, It's just showing same values of Measure what we have. 

For better undstarnd of my requirment kindly go through below link

 

https://community.powerbi.com/t5/Desktop/How-to-display-selected-values-details-and-remaining-should...

 

Hope i't s helpful

 

Thanks in advance

Try Like.

Critial YTD = CALCULATE([Critical],FILTER('Date','Date'[Date]<=maxx('Date',ENDOFYEAR('Date'[Date])))) 

@amitchandak 

 

Can u send me any sample. I have tried your second method, but same measure values showing the visual.

 

Thanks 

Check Minor YTD :https://www.dropbox.com/s/hkv1jhe18gh3sq9/severity.pbix?dl=0

 

I removed few filter get data for more dates

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.