Tableau data extract refresh - refresh

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

Related

Order date in a table

Hi I'm trying to order a table in BI by monthNumber, but now I have same months in differents year, and PowerBI doesn't care about that. I have:
Jan-20
Feb-19
Feb-20
Mar-19
Mar-20
Apr-19
May-19
Jun-19
Jul-19
Aug-19
Sep-19
Oct-19
Nov-19
Dec-19
And I want:
Feb-19
Mar-19
Apr-19
May-19
Jun-19
Jul-19
Aug-19
Sep-19
Oct-19
Nov-19
Dec-19
Jan-20
Feb-20
Mar-20
NOTE: Each month I will add a new month (The actual current month e.g. Now Aug-20) and this should still work properly
Let your table name is "order_by_month" and the column name is "month_year". Now just follow this following steps to order data as per your requirement.
Step-1: In Power Query, create a custom column as below image-
We are generating this column with the First date of each month so that we can order our original data later based on the Date value. The generated value in the new column will look like below-
Step-2: Change the above red marked column's data type as Date.
Step-3: Get back to report by clicking the "Close & Apply" Button.
Step-4: In the report, go to Table view and select your original column "month_year" and order this column by newly created column "date_formatted_value" as shown in the beloe image.
Now the final output will be sorted as below as you wants-

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

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

Power BI: Fill gaps between two dates, exclude dates outside range

So I am looking to display payments from individual donors over a time period between their first donation, and today's date.
To fill gaps in a visual representation of donations over time, I use a calendar table and select ‘show items with missing data.’
My issue is that if a donor first donated in 2005 the fact that the calendar table starts in 1980 means the graph shows an X axis date range starting that year. So it's showing a lot of time we know has no data.
How can I default the date range to start at the date of the first donation of the user ID passed to the report?
Tables: Calendar, Donations
One way to achieve this is to create a measure that checks to see if there are donations within the current filter context. For your chart this will be for the date and donor category selections, though this would work in any other filter context that relates to donations.
It will look similar to this:
Has Donations =
if(calculate(isempty(relatedtable(DonationsTable
)
)
)
,0
,1
)
You can then add this filter to the Filters on this visual section of the Filter Pane and check for where the value is 1, though make sure your date axis is set to continuous. This will return all dates between the oldest and newest donation.

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"

Power bi sql live data on demand

Is there any way to add datepicker to report and based on datepicker value can we get the live data from sql server on demand?
Thanks in advance.
You can pass the date filters in the URL of your report. This means to add a query string parameter like this:
?filter=SalesData/SaleDate ge 2018-01-01 and SalesData/SaleDate se 2018-12-31
To filter the SalesData table on SaleDate field to show only data for 2018.
You can create one helper report with a date table and slicer, which will generate the actual link to your report. To do this, create a new calendar table (from Modeling -> New Table) with the dates you want, e.g.:
Date = CALENDAR (DATE(2000;1;1); DATE(2030;12;31))
Create a new measure to calculate the filtered URL:
ReportUrl = "https://app.powerbi.com/groups/xxxxx/reports/xxxxx?filter=SalesData/SaleDate ge " &
FORMAT(MIN('Date'[Date]); "yyyy-MM-dd") &
" and SalesData/SaleDate se " & FORMAT(MAX('Date'[Date]); "yyyy-MM-dd")
Do not forget to replace xxxxx with actual group and report IDs. Make sure the measure data category is Web URL to make it a hyperlink. Show it somewhere, where the user can click on it: