cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Varun511
Helper I
Helper I

YTD calculation based on Month name

HI,

 

Have Period  column which have Jan to Dec if i select  lets say March need to see all  my values till march 

 

dont have date column in my dataset in order to use time intelligence functions 

 

any  help highly appreciated 

 

 

1 ACCEPTED SOLUTION
lukiz84
Solution Sage
Solution Sage

Add a calculated column:

 

MonthNumber := MONTH("1. " & table[Period])

 

Then use the measure:

 

SumOfValuesYTD = 
   CALCULATE(
      SUM(table[Values]), 
      table[MonthNumber] <= SELECTEDVALUE(table[MonthNumber])
  )

View solution in original post

1 REPLY 1
lukiz84
Solution Sage
Solution Sage

Add a calculated column:

 

MonthNumber := MONTH("1. " & table[Period])

 

Then use the measure:

 

SumOfValuesYTD = 
   CALCULATE(
      SUM(table[Values]), 
      table[MonthNumber] <= SELECTEDVALUE(table[MonthNumber])
  )

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors