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
Shubham_Yadav
Helper I
Helper I

how can i filter table and line chart to show 30 days of data

Hi, i want to show 30 days data in table and chart, 

Shubham_Yadav_0-1654600809456.png

I want to show top 5 highest data in table from 30 days and show them in below chart but having x axis showing those 30 days dates.

 

I have start and end measures which is being used to filter the report

Shubham_Yadav_1-1654601137899.png

Shubham_Yadav_2-1654601173283.png

Any help will be appreciated

 

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Shubham_Yadav ,

 

You could create a measure like below:

Mesure = 
var end_date_measure = [start_date_measure] + 30
return
IF(SELECTEDVALUE('Table'[date]>=[start_date_measure]&&SELECTEDVALUE('Table'[date])<end_date_measure,1,0)

Add this measure to the visual filter and set value = 1.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @Shubham_Yadav ,

 

You could create a measure like below:

Mesure = 
var end_date_measure = [start_date_measure] + 30
return
IF(SELECTEDVALUE('Table'[date]>=[start_date_measure]&&SELECTEDVALUE('Table'[date])<end_date_measure,1,0)

Add this measure to the visual filter and set value = 1.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
croberts21
Responsive Resident
Responsive Resident

Do you always want to show the chart for the past 30 days only basedon today's date? For this, use the TODAY() function in a formula sort of like this: TODAY()-30. 

Or do you want to have the user enter the date which is 30 days prior to today?

Hi @croberts21 , i want to show 30 days of data as per user selection on start date, as it is flexible i.e user can select any value from start .So it will be a range of data from start to end and not TODAY() data

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.