Skip to content

Instantly share code, notes, and snippets.

@random82
Last active December 19, 2018 01:46
Show Gist options
  • Save random82/6a94e7fb110e35551a7af39efe6196cc to your computer and use it in GitHub Desktop.
Save random82/6a94e7fb110e35551a7af39efe6196cc to your computer and use it in GitHub Desktop.
DAX Pattern - % Actual YTD over total budget
% Actual vs Budget YTD OPEX = 
IF(
	ISFILTERED('Calendar'[Date]),
	ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
	DIVIDE(
	TOTALYTD(
	    SUM('OPEX'[Actual]),
	    'Calendar'[Date].[Date]
	),        
	CALCULATE(
	    SUM('OPEX'[Budget]),
	    ALL('OPEX')
	)        

)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment