cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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())))`

1 ACCEPTED SOLUTION
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
4 REPLIES 4
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
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

Frequent Visitor

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

Super User

You are welcome.

Regards,
Ashish Mathur
http://www.ashishmathur.com

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.