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
ContabilidadBI
Helper III
Helper III

Problem with DATESMTD

Hello guys,

 

I am new to power BI and I have been struggling to make a simple month to date sales card for a few hours. Here is the formula:

 

MTD de Total = CALCULATE(SUM(Albaranes[Total]);DATESMTD(Calendario[Fecha]))

 

And here is the fact table of sales and the Calendar table:

 

Captura.PNG

 

 

Now we are in May, so I should be getting the sum of sales amount since 1/5/2017 until today: 4/5/2017 .  Instead I am getting BLANK as the output. What am I doing wrong?

 

Thanks for all the help and learning I am getting from this forum!!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Your english is great!

 

*if* you calendar stopped at the end of May... this would work fine.

 

Ignoring that, you can add a calc column on your calendar table:

IsCurrentMonth = IF (MONTH(TODAY()) = MONTH(MyCalendar[Date]), TRUE(), FALSE())

 

Then set a filter on the card visual to IsCurrentMonth = TRUE  ?

View solution in original post

14 REPLIES 14

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.