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

Calculate Cumulative Variance help

I am trying to sum up my variance for fiscal month to date and it's being troublesome, my DAX query is - Thank you in advance

Measure_with_yearfilter = CALCULATE([Revenue_Variance], FILTER(fact_invoice_tx_financials,[Missed_Revenue] = 1),FILTER(dim_date,YEAR(dim_date[Date]) = YEAR(TODAY())))

 

image.png

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi @lmundia,

 

Try this

 

=SUMX(SUMMARIZE(fact_invoice_tx_financials,dim_date[Fiscal Month],"ABCD",CALCULATE([Revenue_Variance], FILTER(fact_invoice_tx_financials,[Missed_Revenue] = 1),FILTER(dim_date,YEAR(dim_date[Date]) = YEAR(TODAY())))),[ABCD])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi @lmundia,

 

Try this

 

=SUMX(SUMMARIZE(fact_invoice_tx_financials,dim_date[Fiscal Month],"ABCD",CALCULATE([Revenue_Variance], FILTER(fact_invoice_tx_financials,[Missed_Revenue] = 1),FILTER(dim_date,YEAR(dim_date[Date]) = YEAR(TODAY())))),[ABCD])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
BILASolution
Solution Specialist
Solution Specialist

Hi @lmundia

 

Try this...

 

Measure_with_yearfilter =

var actualmonth = FIRSTNONBLANK(dim_date[Fiscal_Month_Sort];1)

return

CALCULATE
(
	[Revenue_Variance],
	ALL('dim_date'),
	YEAR(dim_date[Date]) = YEAR(TODAY()),
	dim_date[Fiscal_Month_Sort] <= actualmonth
)

I hope this helps

 

Regards

BILASolution

returned the first fiscal month numbers, thank you for chipping in. 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.