Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Greetings,
So I Created a date range slicer that gives me + and - 30 days but now I need the tests that were run between those dates.
I have a DATE SLICER and it shows dates in between the DATE SLICER however I am trying to show test that are 30 days prior and after the dates of the DATE SLICER
Most videos use measures or calculations to display however my informatio is a string.
Below is my date range calculation
Then a display of the 60 days forward and backward
Third is my date slicer
Fourth is what I am trying to show versus what is showing.
Solved! Go to Solution.
Hi @Anonymous ,
According to my understanding ,you want to filter table dynamically based on a slicer which date is between 30 days ahead and later, right?
You could use the following formula:
//create a table lists all date
calenderTable =
CALENDAR (
MIN ( 'Date Table'[Date Plated] ),
MAX ( 'Date Table'[Date Plated] )
)
//create date period
dateBetween =
VAR selected =
MAX ( calenderTable[all date] )
VAR minDate = selected - 30
VAR maxDate = selected + 30
RETURN
IF (
SELECTEDVALUE ( 'Date Table'[Date Plated] ) <= maxDate
&& SELECTEDVALUE ( 'Date Table'[Date Plated] ) >= minDate,
1,
0
)
My visualizations look like this after applying filter:
Is the result what you want? If not, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
Best Regards,
Eyelyn Qin
Hi @Anonymous ,
According to my understanding ,you want to filter table dynamically based on a slicer which date is between 30 days ahead and later, right?
You could use the following formula:
//create a table lists all date
calenderTable =
CALENDAR (
MIN ( 'Date Table'[Date Plated] ),
MAX ( 'Date Table'[Date Plated] )
)
//create date period
dateBetween =
VAR selected =
MAX ( calenderTable[all date] )
VAR minDate = selected - 30
VAR maxDate = selected + 30
RETURN
IF (
SELECTEDVALUE ( 'Date Table'[Date Plated] ) <= maxDate
&& SELECTEDVALUE ( 'Date Table'[Date Plated] ) >= minDate,
1,
0
)
My visualizations look like this after applying filter:
Is the result what you want? If not, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
Best Regards,
Eyelyn Qin
@Anonymous - It's hard to say exactly not knowing your source data. You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
Otherwise:
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
@Anonymous , let this approach if want additional dates to be displayed
https://www.youtube.com/watch?v=duMSovyosXE
refer if you want every day formula is rolling
Rolling 60 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX(Sales[Sales Date]),-60,Day))
Rolling 60 + 60 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX(Sales[Sales Date])-60,120,Day))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
Appreciate your Kudos.
User | Count |
---|---|
101 | |
90 | |
80 | |
71 | |
70 |
User | Count |
---|---|
114 | |
99 | |
97 | |
73 | |
72 |