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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
FatalLordes
New Member

New User - Question about Date Manipulation

Hi All.  Very new user to PowerBI.  My data source presently is a CSV file.  It includes date start and end fields.  What I need to do is run a filter on the date start as I only want to show data where the date start is EITHER 7 days before the date the report is run or 4 weeks after the date the report is run.  I don't want to see data for anything outside of that range.  I've worked out using relative date is the trick but I only seem to be able to do one or the other when using relative date?  As in I can either show 7 days prior, or I can show 4 weeks after.  I can't work out how to show all data where it is between 7 days prior and 4 weeks after?  What am I missing?

1 REPLY 1
amitchandak
Super User
Super User

@FatalLordes , If you need it with dat selection.

 

Create a disconnected date table. Do not join with date of your table

 

//Date1 is independent Date table
new measure =
var _max1 = maxx(allselected(Date1),Date1[Date])
var _min = _max1+7
var _max = _max1+28
return
calculate( sum(Table[Value]), filter('Table', 'Table'[Date] >=_min && 'Table'[Date] <=_max))

 

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors