Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

DAX filter for the current month in date dimension is needed

Hello, I created a measure in DAX (see below) to return the total anual budget ignoring filters:

 

 

Anual Budget = CALCULATE(SUM(FactBudget[BudgetValue]),ALL(DimDate[Date]))

 

 

The budget Fact contains budget values in the same granularity as the Date Dimension (DimDate). Thus, there is one value on each day.

 

FactBudget (Table)

 

 

Date            | BudgetValue

-----------------------------

2018-01-01 | $100

2018-01-02 | $ 200

....

 

Date Dimension DimDate

 

Date

------

2018-01-01

2018-01-02

...

I would like to do the same to claculate the total budget of the current month only what will be needed instead of 

ALL(DimDate[Date])

?

 

What I need is something like Monthly Budget = CALCULATE(SUM(FactBudget[BudgetValue]),GETCURRENTMONTH(DimDate[Date])) where GETCURRENTMONTH does not exist.

 

What I tried but it does nto return correct results was:

 

Monthly Budget = CALCULATE(SUM(FactBudget[BudgetValue]),(YEAR( DimDate[Date] ) = YEAR ( TODAY()) && MONTH( DimDate[Date] ) = MONTH (TODAY ())))

 

Thanks! 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I solved the issue in the meanwhile. Here is the solution that worked for me and what I was doing wrong:

 

Monthly Budget = CALCULATE(SUM(FactBudget[BudgetValue]),DATESBETWEEN(FactBudget[Date],DATE(YEAR(TODAY()), MONTH(TODAY()), 1),EOMONTH(today(),0)))

So the issue was that I was using the Date Dimension which is a rolling Date dimension to show dates only till today so I had to get the date from the original budget table.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I solved the issue in the meanwhile. Here is the solution that worked for me and what I was doing wrong:

 

Monthly Budget = CALCULATE(SUM(FactBudget[BudgetValue]),DATESBETWEEN(FactBudget[Date],DATE(YEAR(TODAY()), MONTH(TODAY()), 1),EOMONTH(today(),0)))

So the issue was that I was using the Date Dimension which is a rolling Date dimension to show dates only till today so I had to get the date from the original budget table.

vishnurk
Frequent Visitor

i think what we can do is create a new column that gives the month number from the dates column by editing the query.

Then create measure as below
Monthly Budget = CALCULATE(SUM(FactBudget[BudgetValue]),FactBudget[Month]=MONTH(TODAY()))

 

where Month is the newly created column name

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors