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

TOTALYTD without date reference

Hi folks

 

I am stuck with something. Generally, when using TOTALYTD PowerBI needs a date reference e.g. a date axis in the KPI Visual or the line chart. When I want to present the number standalone, e.g. in a Card visual it will return a blank.

I need to show the % difference between the YTD Actual and Budget value as well as previous year in a card visual so that it can be used to trigger meaningful Alerts. The page in the report is filtered to only show the current month.

My measures are:

Actual ValueYTD = 
	VAR ReturnValue =
	TOTALYTD([Actual Value];'PowerBI_Dim_DateDay'[Date])

	RETURN

	IF(MAX('PowerBI_Dim_DateDay'[Date])<=TODAY();
    	ReturnValue)

Actual Value running total in Date =
CALCULATE(
  [Actual Value];
  FILTER(ALL('PowerBI_Dim_DateDay');
   ISONORAFTER('PowerBI_Dim_DateDay'[Date]; MAX('PowerBI_Dim_DateDay'[Date]); DESC)
  )
)


The latter running total I took to avoid the date reference, but as I have two years of data in my model, it shows the YTD for both years instead of only the current year. When using ALLSELECTED it shows the actual value of the current month (as this is filtered on that page)

The first one only shows the correct value in a KPI Visual.

It goes without saying that the difference measure doees not work thus far.
Capture.PNG
Can anoyone help me?

Thanks in advance!

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

you can add Visual level relative filter set to current month:

Capture.PNG



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

you can add Visual level relative filter set to current month:

Capture.PNG



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

Thank you  @Stachu I did not think about this one.
Removing the page level filter brought back the correct number from the Running Total Measure and applying visual level filters to all the other visuals helped and solved the problem.


 

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.