Forum Discussion
Line Chart, with comparison time
- 6 years ago
Unicorn_Tech you need to set relationship between date table and your original table and then you can use parallelperiod function as described in the link.
Unicorn_Tech As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.
https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-calculations/
Once you have date dimension in your model, you can use previousday, previousmonth, previousyear, all these time intelligence functions in your measure
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
@parry2k, that sounds like what I need exactly, but I might need a bit more of an explanation here. I have a single table, that has dates, and pageviews. I take it you aren't suggesting an additional column, and I did build a seperate table of Dates, per the link you hd put in.
Currently, the date table I created and my original table are unrelated. How does the Timeline dax fit into this now?
I think the timeline feature I'm most interested in is PARALLELPERIOD
- parry2k6 years agoSuper User
Unicorn_Tech you need to set relationship between date table and your original table and then you can use parallelperiod function as described in the link.
- v-deddai1-msft6 years agoCommunity Support
Hi Unicorn_Tech ,
When we use time intelligence function. It always need a complete, uninterrupted calendar table. You need create a date table and create relationship between it and original.
Here is two link that many help you learn more about it:
https://softcrylic.com/blogs/power-bi-for-beginners-how-to-create-a-date-table-in-power-bi/
https://www.sqlbi.com/articles/time-intelligence-in-power-bi-desktop/
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
- Unicorn_Tech6 years agoResolver I
v-deddai1-msft parry2k , I really appreciate your help here.
I have my seperate date table. I have marked it as a date table. I have set up a relationshipt between the Date table (Date) to my data table with page views (Date.)
I don't understand how now to calculate a parallel period. Is this done in a table, an extra column? Is this done in the reporting view?
My visual is a line chart that shows page views for the past 30 days. I am now using the field of date from the date table, and the page views column from the data table.
How can I now show a seperate line, with the parallel period.
I appreciate the help - I am learning!- Unicorn_Tech6 years agoResolver I
Hello. Based on internet links, this is what I tried to do, inside my date table:
Date =VAR __dates = CALENDARAUTO()RETURNADDCOLUMNS (__dates,"Year", YEAR ( [Date] ),"Month Number", MONTH ( [Date] ),"Month Name", FORMAT ( [Date], "MMMM" ), --use MMMM for full month name, January instead of Jan"Month", FORMAT( [Date], "MMM, YYYY" ), --use MMMMM for full month name, January instead of Ja"Month Sort", FORMAT( [Date], "YYYY-MM" ),"Quarter", "Q" & FORMAT( [Date], "Q, YYYY" ),"Quarter Sort", FORMAT ( [Date], "YYYY-Q" ),"Par", calculate(sum('All Web Site Data'[Pageviews]),'All Web Site Data'[Date],PARALLELPERIOD('All Web Site Data'[Date],-1,MONTH))The bold text is returning the same value for each row, rather than returning the total page views for the particular date, in the parallel period.