Forum Discussion
Can't replicate Microsoft Tutorial for the Time Intelligence Function
So, I am trying to learn the basics of Power BI. I am trying to figure out how do the time intelligence functions work.
I am looking at this page: https://support.powerbi.com/knowledgebase/articles/554619-dax-basics-in-power-bi-desktop
The page teaches to use CALCULATE and PREVIOUSQARTER functions. The result of their manipulations looks like this:
However, when I am using their file and their data (can be downloaded from the tutorial page), and copy all the steps, I still don't get same results. Previous Quarter bar doesn't show up. Only the Sales Amount.
Can somebody please look into this? I assume the formula that they have must be wrong:
Previous Quarter Sales = CALCULATE(SUM(Sales[SalesAmount]), PREVIOUSQUARTER(Calendar[DateKey]))
- Anonymous10 years ago
I think I found my mistake. My date field was actually a new column created within Power BI. Once I made a column in the original Excel file instead - the problem disappeared
5 Replies
- PowerBIGuyResponsive Resident
Try adding a report filter and filtering by a single year example(2013).
- AnonymousNot applicable
Thank you! It worked. However, I still can't get my dashboard to do the same. I fully replicated the logic, but my measure doesn't return any results.
I have several locations, and I have a monthly score for each location (I record them into the 1st of every month). As a part of dashboard, I want to have a measure of score increase (difference between any given month and a prior month). That's why I am trying to figure out the prior month using time intelligence function PREVIOUSMONTH.
Is there any more resources to read about this function, besides basic description in Microsoft's knowledge base?
- PowerBIGuyResponsive Resident
When using the time inteligence functions ensure that your date field is label as a data type of date within power bi desktop. Edit Query -> Home -> Select your date field and ensure that data type is listed as date.