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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
RasDev1
Frequent Visitor

I need to display last 30 days bar chart

Hi members , I am new to power pi ,
I need to display the last 30 days in the graph,
I added a filter to last 30 days,its work good
but the problem is when i search a previous months (example may month)it should be blank .
how to rectify the issue?
see images

RasDev1_0-1729146859144.png

 

RasDev1_0-1729148368509.png

 

 

1 ACCEPTED SOLUTION
uzuntasgokberk
Super User
Super User

Hello @RasDev1,

You can create a measure:
test=

VAR x_=
    CALCULATE(
        MAX('your table'[_Date]),
        REMOVEFILTERS('yourtable'[Date])
    )
RETURN

IF(
    SELECTEDVALUE('yourtable'[Date]) >= x_ -30,
    1,
    0)

And make it filter in filter pane as 1. İt is working sync with your filter.
uzuntasgokberk_0-1729160934878.png

 

Best Regards,
Gökberk Uzuntaş

LinkedIn: https://www.linkedin.com/in/g%C3%B6kberk-uzunta%C5%9F-b43906198/

Medium: https://medium.com/@uzuntasgokberk

 

İf this post helps, then please consider Accept it as solution and kudos to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
uzuntasgokberk
Super User
Super User

Hello @RasDev1,

You can create a measure:
test=

VAR x_=
    CALCULATE(
        MAX('your table'[_Date]),
        REMOVEFILTERS('yourtable'[Date])
    )
RETURN

IF(
    SELECTEDVALUE('yourtable'[Date]) >= x_ -30,
    1,
    0)

And make it filter in filter pane as 1. İt is working sync with your filter.
uzuntasgokberk_0-1729160934878.png

 

Best Regards,
Gökberk Uzuntaş

LinkedIn: https://www.linkedin.com/in/g%C3%B6kberk-uzunta%C5%9F-b43906198/

Medium: https://medium.com/@uzuntasgokberk

 

İf this post helps, then please consider Accept it as solution and kudos to help the other members find it more quickly.

Kedar_Pande
Super User
Super User

Create a Measure

ShowGraph = 
IF(
MAX('YourDateTable'[Date]) < TODAY() - 30,
0, // or BLANK()
1
)

Add the ShowGraph measure to your graph's filters area and set the filter to only show when ShowGraph equals 1.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

 

Same issue is repeat

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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