I have quarterly data for 2018 (Q1-Q3) which I would like to compare with the same time periods from a year ago so 2017 Q1-Q3.
Where it gets a little tricky is that I would like for my workbook to be smart enough in Q1 2019 to know that it only compares for one quarter in 2018 and when Q2 2019 data rolls in it uses 2 quarters and so on and so on.
Is this possible in Tableau?
For those that are interested I have generated some random data in the format of my workbook in Excel for import into Tableau. Here is the link to the data.
Try the following:
IF DATEPART('year',[datefield]) - 1 = DATEPART('year',TODAY())
AND DATEPART('quarter',[datefield]) < DATEPART('quarter',TODAY())
THEN [valueField]
END
This will compare with previous year's data.
Related
I have created a visualization that gives me the percentage change in the number of sales from one year to the next.
This visualization varies according to a date filter.
I have data since March 1st 2021.
Here is my problem: If I filter on the period "January 1, 2022 to October 1, 2022" I have a problem with my visualization, it will be false because it will compare this period of 9 months with the same period in 2021, except that in 2021 I am missing 2 months (January and February 2021).
Do you know if it is possible to display nothing on this visualization if the filtered period starts before March 1st 2022?
I prefer to display nothing rather than a false value.
i think a solution here would be adding a parameter to the visual instead of a slicer.
With the formula if & else.
I have downloaded a dataset called Real estate valuation data set from https://archive.ics.uci.edu/ml/datasets/Real+estate+valuation+data+set?source=post_page . But I am not able to understand in which format the transaction date is given. They have given some examples like 2013.250=2013 March, 2013.500=2013 June, etc.
I encountered this same problem and I figured that the months were represented as a fraction of a year. So, for instance, June is the 6th month of the year, hence it is 6/12 = 0.5; that's why we had June 2013 as 2013.500, etc.
I have a requirement in which I have to show the data of last month of each year. So I used a max_month LOD expression which is working fine for all the years except rolling year. My rolling year ranges from Aug 2017 to July 2018. Now when I am using max_month filter for rolling year it is showing me the data of december 2017, but in actual I want to show july 2018. What will be the right approach to fix this?
I am not sure even if your formula worked, its missing basic syntax, and based on your explanation table calculation is missing the Computation logic.
Implemented the same at my end and below is the logic.
Formula to be used:
If MAX(MONTH([Order Date]))=WINDOW_MAX(MAX(MONTH([Order Date])))
THEN 'TRUE'
ELSE 'FALSE'
END
For this table calculation you need to compute along year and corresponding dimension and reset at every year (I guess you are missing this in your current logic).
Let me know how it goes
I have a tableau worksheet that shows a count of records by date. Current system date is Mar 14 but my dataset has data only till Mar 9. Is it possible to show dates from Mar 10 - Mar 14 even though there is no data for this time frame.
Given is a snapshot of my worksheet, kindly let me know how could I include all dates in the row even though there is no data for this time period.
Select discrete row it will show the date on a sheet
I need to compare data from this year with the data from last year. So the customer wants to switch between full year and year-to-date comparison. The full year i already have, but with year-to-date they want to see how the are going now compared to the data from today last year e.g.:
full data from Jan 2016 - 24. Aug (today) compared to Jan 2015 - 24. Aug 2015.
How to implement this in DAX? I'm using this in Power BI.
Supposing you have a measure called [Sales], calculated from a fact table, and a Dates table, you can write 2 new measures to compare data from this year and the previous:
Sales YTD = CALCULATE ( [Sales]; DATESYTD ( 'Dates'[Date] ) )
Sales PY YTD = CALCULATE ( [Sales]; DATEADD ( DATESYTD ( 'Dates'[Date] ); -1; YEAR ) )
Putting it in a matrix visualization, it would give you the following:
Please remember to have your 'Dates' relationship to the Sales table correctly configured in order to have your time intelligence calculations done right. You can find more info here.