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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Dmytro_13
New Member

How to display data on the chart for only one month by day with current filter context.

Good day, dear community. Stuck on this question. It is necessary to display the data on the chart only for one month by day, depending on the context of the filters (Year, Month). If neither the month nor the year is selected, then display the data for one month by days for the last year, month (where data is available). If month not selected, but selected year, then display the data for one month by days for the selected year and the last month of this year where the data is available. If the month and the year are selected, then display the data for one month by days for the selected year, month. If the month is selected, but the year is not selected, then display the data for this month by days for the last year. I will be very grateful for your help.

Dmytro_13_0-1659515402998.png

Here is the sctructure of the model:

Dmytro_13_2-1659516230099.png

 

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Dmytro_13 , if you need based on today, use this measure in visual or visual level filter

 

example

This Month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for quick answer, but it is not exactly I want. For example, if I chose 2017 year, data disappear.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors