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
lmundia
Frequent Visitor

Rolling totals

I have two DAX queries that I am not sure how to combine to get the outcome that I need. I want my revenue running totals to roll up to Quarter, half year and year like in my second column (in the image below) but also have the cummulated change Month over Month like my first column. Thank you in advance 

Revenue_Variance  Running Totals = 
CALCULATE(
	'fact_financials'[Revenue_Variance],
	FILTER(
		CALCULATETABLE(
			SUMMARIZE(
				'dim_date',
				'dim_date'[fiscal_month_number],
				'dim_date'[month_name],
				'dim_date'[fiscal_quarter],
				'dim_date'[fiscal_half_year],
				'dim_date'[fiscal_year]
			),
			ALLSELECTED('dim_date')
		),
		ISONORAFTER(
			 'dim_date'[fiscal_year], MIN('dim_date'[fiscal_year]),DESC,			 
			 'dim_date'[fiscal_half_year], MIN('dim_date'[fiscal_half_year]),DESC,
			 'dim_date'[fiscal_quarter], MIN('dim_date'[fiscal_quarter]), DESC,
			 'dim_date'[fiscal_month_number], MIN('dim_date'[fiscal_month_number]), DESC,
			 'dim_date'[month_name], MIN('dim_date'[month_name]), DESC
		)
	)
)
Revenue_Variance running total in Revenue = 
CALCULATE(
	'fact_financials'[Revenue_Variance],
	FILTER(
		ALLSELECTED('fact_financials'[Revenue]),
		ISONORAFTER('fact_financials'[Revenue], MAX('fact_financials'[Revenue]), DESC)
	)
)

image.png

1 REPLY 1
v-ljerr-msft
Employee
Employee

Hi @lmundia,

 

Could you post your table structures with just some sample/mock data, and the expected result against the data? So that it will be easier for us to do some tests on it, to see if we can find a solution for you. It's better that you can just share a sample pbix file. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading. Smiley Happy

 

Regards

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.