Forum Discussion
Difference of value between dates
Hello Everyone,
I am a new user of PBI, and now I am struggling with a formula, hope someone can guide me on how to do it,
Basically what I want to do is calculate de difference or growth between different dates,
Here is my table above, I have the total of calls and the unique calls giving me the % of the repeat callers, so, what I need is the difference of that % between the dates, for example, from week 30 to 31 there is a difference of 0.5% but I don't know how to create the correct measure to calculate it.
I appreciate your help.
Hello Rsosa,
If you are having only days insted of full date in WKN column you can try below measure, only replace "TABLENAME" with Your table name%diff=var todaysdate = MAX(TABLENAME[WKN])var previousdaydate= todaysdate -1var todayscount =CALCULATE(SUM(TABLENAME[Repeatecaller]),TABLENAME[WKN]=todaysdate )var previousdaycount=CALCULATE(SUM(TABLENAME[Repeatecaller]),TABLENAME[WKN]=previousdaydate)returnIF(previousdaycount=BLANK(),BLANK(),todayscount -previousdaycount)
Use a table or matrix visualIf you have full date you can replace it with WKN column.
If previous solution works for you please mark as solution.
4 Replies
- kiran_jadhavFrequent Visitor
Hello Rsosa,
If you are having only days insted of full date in WKN column you can try below measure, only replace "TABLENAME" with Your table name%diff=var todaysdate = MAX(TABLENAME[WKN])var previousdaydate= todaysdate -1var todayscount =CALCULATE(SUM(TABLENAME[Repeatecaller]),TABLENAME[WKN]=todaysdate )var previousdaycount=CALCULATE(SUM(TABLENAME[Repeatecaller]),TABLENAME[WKN]=previousdaydate)returnIF(previousdaycount=BLANK(),BLANK(),todayscount -previousdaycount)
Use a table or matrix visual- RSOSANew Member
It works! thank you so much, but, a follow-up question, what if I want this same, but apply for month and week whenever I apply any drill down?
Here is what I got so far, It works perfectly when it comes to a day, but as you can see, the week is showing the last value of the day and is not comparing to the previous week, same for the month.
Is there a way to do so?
- kiran_jadhavFrequent Visitor
If you have full date you can replace it with WKN column.
If previous solution works for you please mark as solution.
- kiran_jadhavFrequent Visitor
Can you share snap of your data model, Or dummy data if possible to share?