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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

month and Year

Hi i'm trying to calculate Pro Bono Hours of the current month and year.

 

I originally had the below formula, but that required me to update every month.

 

MTD Billable = CALCULATE([Pro Bonos],FILTER('Work Date','Work Date'[Calendar Year]="2021" && 'Work Date'[Calendar Month]="August"))

 

So I wrote the below formula however, it isn't  working. any assistance would be helpful.

 
MTD Pro Bono = CALCULATE([Pro Bono],FILTER('Work Date','Work Date'[Calendar Year]=YEAR(TODAY() && 'Work Date'[Calendar Month]=MONTH(TODAY())))) 
 
Thanks
2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@Anonymous Your parens are wrong:

MTD Pro Bono = 
  CALCULATE(
    [Pro Bono],
    FILTER(
      'Work Date',
      'Work Date'[Calendar Year]=YEAR(TODAY()) && 
      'Work Date'[Calendar Month]=MONTH(TODAY())
    )
  ) 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

@Anonymous Try:

MTD Pro Bono = 
  CALCULATE(
    [Pro Bono],
    FILTER(
      'Work Date',
      'Work Date'[Calendar Year]=YEAR(TODAY()) && 
      'Work Date'[Calendar Month]=FORMAT(TODAY(),"mmmm")
    )
  ) 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@Anonymous Your parens are wrong:

MTD Pro Bono = 
  CALCULATE(
    [Pro Bono],
    FILTER(
      'Work Date',
      'Work Date'[Calendar Year]=YEAR(TODAY()) && 
      'Work Date'[Calendar Month]=MONTH(TODAY())
    )
  ) 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler 

 

Hi Greg, 

 

Thank you I've updated the measure but recieved the below error

 

kari1282_0-1629394493490.png

 Is it because the 'Work Date'[Calendar Month] is listed as August and not 8

Hi,  @Anonymous 

Could you please tell me whether your problem has been solved?

If yes, you could accept the helpful answer as solution. 
For now, there is no content of description in the thread. If you still need help, please share more details.

 

Best Regards,
Community Support Team _ Eason

@Anonymous Try:

MTD Pro Bono = 
  CALCULATE(
    [Pro Bono],
    FILTER(
      'Work Date',
      'Work Date'[Calendar Year]=YEAR(TODAY()) && 
      'Work Date'[Calendar Month]=FORMAT(TODAY(),"mmmm")
    )
  ) 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.