how to show data based on date slicer but from 2 dates columns - powerbi

Currently, I have a report that displays a series of data that I can filter on the basis of a "date slicer (type 'between')". This slicer works with as specifi column "i_date" because a date table (m_date[date]) is used for the slicer and the "i_date" (from another table "interv") is linked together (1:n relathions).
In this other table there is another date type column with the last modification date of the row (interv[modified]).
Now, when a period is selected with the date slicer, I'd like to show the data where interv[i_date] OR interv[modified] are inside the selected period.
How can I do that ?
Using a new column with the newest date between interv[i_date] OR interv[modified] is not a solution, because in this case if a row is modified after the period, it will not be shown. (because interv[i_date] < interv[modified])

solved with a second slicer simply

Related

Return Difference of Value Given 2 Different Date Slicers

I have 2 date slicers and a measurement which is [Profit], I would like to return the difference in Profit given the date selections. Please see below for detail.
Date Slicer 1: 3/7/2021-3/13/2021
Date Slicer 2: 3/14/2021-3/20/2021
Profit given Date Slicer 1: 10
Profit given Date Slicer 2: 15
Value I am trying to get = 5 (15-10)
If the two slicers come from the same Date column, both periods do not intersect each other and you get a filter without dates.
Possibly there are better solutions but one of them would be to use a Harvester Filter (Creating an additional table containing a copy of the date column unrelated to the model, aka Disconnected Tables)
Before moving on to the next part you can verify that the filter contains the same dates but since it is a disconnected table, it does not filter the model, yet
For the [Profit given Date Slicer 1] you can use the original measure
For the [Profit given Date Slicer 2] you must change the filter to:
DATESBETWEEN(
'Dates'[Date],
MIN(HarvestingDates[Date]),
MAX(HarvestingDates[Date])
)

Power BI Dax Expression Help - Setting default slicer between dates

Power Bi report uses a date slicer (between) - As a default I want it to set the first date in the slicer as Monday (last week) and the last date as Friday (last week). I dont want this to be a relative date but always must be the previous Mon-Fri. I have a column in my data set that tells me which one is the 'Previous Week' as a text field. I dont know how to use this to set a default slicer value. But i also want to make sure the user can change the slicer dates and it changes as per the user request.
Example today is 01/09/2020
I want my default slicer date as : 24/08/2020 - 28/08/2020
I have two measures which gives me by last week dates:
DefaultSD = MINX( FILTER(Data, [WeeksFilter] = "Previous Week Only"),[Date])
DefaultED = MAXX( FILTER(Data, [WeeksFilter] = "Previous Week Only"),[Date])
I assume this is possible using a DAX expression but dont know how to create this expression to populate these default values.
Please note the data is refreshed up until 01/09/2020 so there is currently data for this week but i dont want this to included in the default slicer on report load
You can't set slicer defaults yet but this can be achieved with relative date filtering.
Select date in the last 1 calendar week:

Calculated column based on a disconnected slicer

I'm not sure I've summarised this question correctly, so I'll add a description below of the actual problem.
We have a report that displays data for 'jobs'. These jobs have a few relevant date fields on them such as Created Date, Completed Date and Invoice Date. We currently have 3 slicers on the report that work as expected based on these dates.
Users sometimes use all 3 slicers at the same time and end up with all sorts of useless data. No matter how many times we've told them to reset the filters before changing the date slicers, they keep forgetting to do that.
They also do not want to have 3 separate reports.
We've been tasked with providing them with the following:
Something that lets them select what they want to filter on, with the options only being Created, Completed or Invoiced
A slicer that works based on the option they selected above.
We've tried creating a calculated column that is set to one of those dates based on the option selected in the disconnected slicer, and then adding a slicer that works off that column, but we aren't having any luck. The values in the calculated column are not correct
This is what we've done in attempting to solve the problem:
Create a measure that captures the selected value
SelectedMeasure = SELECTEDVALUE('Date Filter Options'[Name],"Created Date")
Create a calculated column to set the appropriate date value
Please note we're only testing with two out of the three possible values at the moment.
Selected Date Filter = if(jobs[SelectedMeasure] = "Created Date", (jobs[Created Date (DateOnly)]), (jobs[Completed Date (DateOnly)]))
What we're finding is that the Selected Date Filter column does not update with the correct date value, even after we change the slicer and the measure updates as expected.
We're totally stumped - I'm aware we are probably a fair bit away from the correct solution, so any help would be appreciated
Not quite sure how to best present the data model, but here are the relevant fields of the 'jobs' table
jobNumber: string
jobId: guid
CreatedDate: date
CompletedDate: date
InvoicedDate date
The Date Filter Options table just consists of one column with these options:
"Created Date"
"Completed Date"
"Invoiced Date"

Date range filter in clustered column chart

In my Power BI report I have a date slicer and a clustered column chart. In the chart I want to display how much events occurred per hour. For that I have a data table like this:
Date Hour Count
01.01.2019 07:00:00 4
01.01.2019 09:00:00 9
03.01.2019 07:00:00 1
07.01.2019 10:00:00 14
and so on ...
The charts x-axis displays the hour, y-axis the count.
Now I want to be able to filter the chart by date when I change the date range in the slicer. For example when I set the slicer to the range from 04.01.2019 to 10.01.2019, the chart should display the hour histogram only of these 7 days.
Hope you have an idea what I want to do.
Thanks in advance!
EDIT
I've found out why it is not working. The report contains multiple charts, each bound to an own data table. Each table has a date column. The slicer uses one of these date columns, but not the one of the data used by the clustered column chart. Now the date column of the clustered column chart can contain one date multiple times. But the date column which is used by the slicer contains each date only once.
The data table used by the slicer looks like this:
Date some other columns
01.01.2019 ...
02.01.2019 ...
04.01.2019 ...
...
Each date is contained once at the most in contrast to the date column of the first table, where each date can appear more than once. Because of this the slicer works for the one chart but not for the other.
Ok, found the solution and it is very easy. All you have to do is to create a relationship between the date column of table two and the date colum of table one. The slicer uses the date column of table two. If you change the date range now this affects the clustered column chart too.

Power bi - Use Slicer selection in filtering data

I am new to Power bi but i want to use Slicer(user selection) while filter data with comparison by 'Greater Than' instead of equal to.
I have data of devices with LastUpdated date column. and slicer with few list of dates for 15 days gap (calendar would be better but as it is not available yet sticking with dates list)
When user select a date in Slicer i want to filter the data whose Lastupdated Date is greater than equal to selected date. How to achieve this? tried columns,measures..
Any help is appreciated.
I think you can create a measure that links the Date list table and the Device table, even if there is no relationship between them. However the measure must be present in your visualization otherwise the slicer will not affect it.
I've created a measure that calculates the maximum date for those rows which last update date is greater or equal than the slicer selection.
CalculatedLastUpdate =
CALCULATE (
MAX ( DeviceTable[LastUpdate] ),
FILTER (
DeviceTable,
DeviceTable[LastUpdate] >= MINX ( DateList, DateList[Date] )
)
)
DateList - a table containing a column [Date] with you date range.
DeviceTable - a table containing device data.
Now you can delete LastUpdate column from your visualization in order to avoid two columns with the same data.
Let me know if it helps.
I don't know about earlier , but now you can modify the date slicer to do as "after" the given date (you can do so by clicking on the icons present in the rightmost side of the slicer visual itself , wher you can select mode of slicer as between , after ,list , dropdown etc.)...which I believe means that you get all data for dates greater than the selected dates for the given column used in slicer which in your case will be LastUpdate.