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
bdeluca
Frequent Visitor

Add a value to current month

Hello. Simple concept, but I'm not sure how to do it.

 

I have monthly data in a bar chart. If it is after the 15th of the month, I want to add 100 to the measure for the current month only.

 

This is an unsuccessful attempt (because it adds 100 to every month):

 

CALCULATE( IF( day(today()) < 15 , 0 , CALCULATE([measure] + 100 , FILTER('Calendar' , 'Calendar'[CurMonthOffset] = 0 ) ) ) )
1 ACCEPTED SOLUTION

Hi, @bdeluca 

Thank you for your feedback.

Please check the below picture.

Because today is 13th May, and in order to check whether the measure works or not, I input day=12 and it seems working properly. 

Inside the sample pbix file, I input day = 15.

 

Picture1.png

 

https://www.dropbox.com/s/ztmyqf0zkt7gks6/bdeluca.pbix?dl=0 

 

Values Total Custom condition =
SWITCH (
TRUE (),
DAY ( TODAY () ) < 15, [Values Total],
DAY ( TODAY () ) >= 15,
IF (
MAX ( Data[Dates] ) = EOMONTH ( TODAY (), 0 ),
[Values Total] + 100,
[Values Total]
)
)
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
HashamNiaz
Solution Sage
Solution Sage

Hi !

You can use following DAX to get the desired output;

 

New Measure = 
    VAR _CurrentYear = YEAR(TODAY())
    VAR _CurrentMonth = MONTH(TODAY())
    VAR _CurrentDay = DAY(TODAY())
    VAR _SelectYear = MAX('Calendar'[Date].[Year])
    VAR _SelectMonth = MAX('Calendar'[Date].[MonthNo])
    VAR _SelectDay = MAX('Calendar'[Date].[Day])
    VAR _AddToMeasure = IF(_SelectYear = _CurrentYear && _SelectMonth = _CurrentMonth && _CurrentDay >= 15, 100, 0)
RETURN
    CALCULATE([Measure] + _AddToMeasure)

 

You are checking Current Year & Month from Today(), then you are validating if against Selected Year &  Month if both are same & day is greater then equal to 15 than assign 10 else 0

You can then use this expression to add to your existing measure.

 

Regards,

Jihwan_Kim
Super User
Super User

Hi, @bdeluca 

Please check the below picture and the sample pbix file's link down below.

 

Picture3.png

 

Values Total Custom condition =
IF (
MIN ( dates[Date] ) > EOMONTH ( TODAY (), -1 )
&& MAX ( dates[Date] )
< EOMONTH ( TODAY (), -1 ) + 15,
[Values Total],
IF (
MIN ( dates[Date] )
>= EOMONTH ( TODAY (), -1 ) + 15
&& MAX ( dates[Date] ) <= EOMONTH ( TODAY (), -0 ),
[Values Total] + 100,
[Values Total]
)
)
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

So close!

 

My data is grouped by month. So I only want to add 100 to the total for the month (not 100 to each day).

Hi, @bdeluca 

Thank you for your feedback.

Please check the below picture.

Because today is 13th May, and in order to check whether the measure works or not, I input day=12 and it seems working properly. 

Inside the sample pbix file, I input day = 15.

 

Picture1.png

 

https://www.dropbox.com/s/ztmyqf0zkt7gks6/bdeluca.pbix?dl=0 

 

Values Total Custom condition =
SWITCH (
TRUE (),
DAY ( TODAY () ) < 15, [Values Total],
DAY ( TODAY () ) >= 15,
IF (
MAX ( Data[Dates] ) = EOMONTH ( TODAY (), 0 ),
[Values Total] + 100,
[Values Total]
)
)
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.