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
MaleneL
Helper I
Helper I

Sum of a report measure

Hi

I am working on creating a YTD measure on the basic of a report measure already created. So I just want it to find the sum of the report measure on the basic of wich month it is:

 

The report measure is:

 

TK (TM) =
VAR _Month = CALCULATE([TK],Timeintelligence[Name] = "Month")
VAR _LastMonth = CALCULATE([TK],Timeintelligence[Name] = "Last Month")
VAR _NewInMonth = CALCULATE([TK_Ny],Timeintelligence[Name] = "Month")

Return
IF(NOT ISBLANK(_Month) && NOT ISBLANK(_LastMonth), ((_LastMonth+_NewInMonth)-_Month))
 
result (exempel) will be:
Jan = 1111
Feb = 2222
March = 3333
etc.
 
so the next step is to (if Excel ;O) to sum the total of TK (TM) for each month
Jan = 1111
Feb = 3333
March = 6666
etc.
 

I have tryed difference approach but without luck 

(SUM, SUMMERIZE, CALCULATE)

Hope you guess can helt 

 

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @MaleneL ,

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

If convenient, the results can be displayed in the form of pictures.

 

Best Regards,

Liu Yang

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

Hi 

sorry for the delay answar.

I have created sample pbix to show the problem but I do not know how to share it?

 

amitchandak
Super User
Super User

@MaleneL , For YTD you can use time intelligence with date table

example

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

 

YTD= CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) && 'Date'[Day of Year] <= Max('Date'[Day of Year]) ))
LYTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year])-1 && 'Date'[Day of Year] <= Max('Date'[Day of Year])))


you can use month no in place of Day of Year, if needed

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Thanks, but unfortannly it does not work for this problem... 

You are using a table for the YTD calculation, this is not possible in this case, I need to find a way to calculate YTD by using the report measure TK (TM)
 

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.