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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Pikachu-Power
Impactful Individual
Impactful Individual

dont show current and previous month until certain date

Hello,

 

I have a bar chart (over 12 month) for the following measure:

CALCULATE(SUM(Table[Value]), Table[Position3] = "DB")
 
In the bar chart I dont wont to show the current and previous month. but after the middle of the current month (when we reached the 15th) I want to show the previous month.
 
had often the problem that my measure also cuts the month of the previous years 2019, 2018...
 
What is the best way to do that?
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

This is quite easy to implement if you can ensure daily updates to the data source. Create a calculated column that checks the day of the month for "Today" and can act as a true/false flag for your other measures.

Pseudo logic: for each date

if (yearmonth(date)<yearmonth(today) && day(today)>14 á yearmonth(date)<yearmonth(today)-1,1,0)

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

This is quite easy to implement if you can ensure daily updates to the data source. Create a calculated column that checks the day of the month for "Today" and can act as a true/false flag for your other measures.

Pseudo logic: for each date

if (yearmonth(date)<yearmonth(today) && day(today)>14 á yearmonth(date)<yearmonth(today)-1,1,0)

Thank you very much! yearmonth doesnt exist... so I used the normal date in combination with EOMONTH.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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