Forum Discussion
Incorrect Previous month total
Hi Experts,
I want to show percentage of previous month. After creating formula
prev got this value instead of 268642.83 total it is showing 2601461.69.
Hi, Uzi2019
According to your picture and description, I guess that you want to make the total row of [prev] display the correct total value, you can create a new measure [prev_new]:
prev_new = var _new=SUMMARIZE('Table','Table'[date],"_value",[prev]) return IF(HASONEVALUE('Table'[date]),[prev],SUMX(_new,[_value]))You should replace the ‘Table’ with your table name, and place this measure into the table chart.
And you can get what you want.
If this result is not what you want, you can post some sample data(without sensitive data) so that we can help you in advance.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- amitchandakSuper User
Uzi2019 , for time intelligence use date table, any missing date will cause the issue
var prev= CALCULATE(SUM(Channel[Cost]),DATEADD('DATE'[date],-1,MONTH))var curr= CALCULATE(SUM(Channel[Cost]))var Ans= Divide([curr]-[prev]),[prev],0) //Avoid - as that will convert it into a text , use divideTo get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.- Uzi2019Community Champion
Hi amitchandak ,
Thanks for your reply.
As I mentioned, I am getting incorrect Prev Month Total which leads to incorrect MoM Growth. So first we have to rectify previous month figure. Individual rows are coming correctly but total is incorrect.
- amitchandakSuper User
Uzi2019 , dateadd need the continuous date, so if the date is not present in table or last month the same date is not present it will give the wrong answer. That is why we need to use date table, which has continous date
example, see for the date where I do not have one month old dates. Any mssing date in this month and last month can casue diff
- Uzi2019Community Champion
Hi amitchandak ,
I have continuous dates. Thats why Row wise i got correct answer. only problem is with Total.
See above data is there for 1 2 and 3rd oct and nov. but still got incorrect total.
See Row wise prev is correct only total is incorrect. it sould be 268642.83.
I have also created same thing using calendar table still getting incorrect and blank answer.
- v-robertq-msftCommunity Support
Hi, Uzi2019
According to your picture and description, I guess that you want to make the total row of [prev] display the correct total value, you can create a new measure [prev_new]:
prev_new = var _new=SUMMARIZE('Table','Table'[date],"_value",[prev]) return IF(HASONEVALUE('Table'[date]),[prev],SUMX(_new,[_value]))You should replace the ‘Table’ with your table name, and place this measure into the table chart.
And you can get what you want.
If this result is not what you want, you can post some sample data(without sensitive data) so that we can help you in advance.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.