If I have 2 tables containg datetime field.
One tables' datetime field contains value like 01-01-2017 00:00:00 (only one value for one date and same time as 00:00:00)
Second tables' datetime field contains value like 01-01-2017 11:30:00 (there can be multiple values for one date and different time)
Now, the problem is if create 2 different charts from these 2 tables with datetime field on x axis. and select one date from first tables' chart: 2nd tables' chart is not getting updated by only selected datetime field on x axis. it is showing all datetime field and just highlighting selected datetime data.
I want to show only selected datetime data in 2nd chart.
Please help!
Related
This question is a follow up to another SO question
I want a bar chart to show the amount of orders in a given date or range. Everything works as expected. However, the x-axis date labels shows a date time value. I want this to show as just a date value as MM-DD-YYYY.
x-axis date labels shows a date time value
How can I change the x-axis date labels to show as a date value as MM-DD-YYYY without the time value
Chart Series Page Designer
Chart Series Source SQL Query
select COUNT(ORDER_ID) AS ORDER_COUNT,
TRUNC(ORDER_DATE) AS ORDER_DATE
from ORDERS_LOCAL
where ORDER_DATE between TO_DATE(:P5_DATE_FROM,'YYYY-MM-DD') and TO_DATE(:P5_DATE_TO,'YYYY-MM-DD')
GROUP BY TRUNC(ORDER_DATE)
FYI: The ORDER_DATE column is saved as a DATE type formatted as YYYY-MM-DD. I don't save the time at all.
X-axis Page Designer
I did try changing the X-axis Value -> Format to Date - Short but that didn't change anything.
Apply a format mask to your date column:
select COUNT(ORDER_ID) AS ORDER_COUNT,
TO_CHAR(ORDER_DATE,'MM-DD-YYYY') AS ORDER_DATE
from ORDERS_LOCAL
where ORDER_DATE between TO_DATE(:P5_DATE_FROM,'YYYY-MM-DD') and TO_DATE(:P5_DATE_TO,'YYYY-MM-DD')
GROUP BY TO_CHAR(ORDER_DATE,'MM-DD-YYYY')
Now the trunc is no longer needed since the time portion is cut off from all dates. Note that you might need add a column with TRUNC(ORDER_DATE) anyways to the query and order by that column. Reason is that TO_CHAR(ORDER_DATE,'MM-DD-YYYY') is a string so the order will be alphabetically and not by date.
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
So I have this database which I will build a dashboard with. A tableau admin will refresh d extract everyday.
example of data
Date item
1-jul. Book
2-jul. Cane
.
.
24-jul Rice
25-jul. Car
Everyday new row is added
Question: how do I set up my date range filters in d data source view so that the extract refreshes by the admin will reflect the current data always.
One solution although bit long is:
Create calculated field "date2" as type date (based on date info from your data.) use date function if e.g year id missing.
Create calculated field "max date" as type date (max(date2))
then create yet another calculated field "max date filter"
If date2 = [max date] then 1 end
Drag filter field to filters and set it to 1
Drag item to rows
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"
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.