Forum Discussion
Anonymous
6 years agoNot applicable
daily change
so i have the following data Country/Region casos Mes Día casos por dia Argentina 1054 abril 1 Argentina 1133 abril 2 79 Argentina 1265 abril 3 132 Argentina 145...
- Anonymous6 years ago
Hi Anonymous
You will need to make sure that you have one column for Date. I create a sample data model with the following columns:
- Country
- Date
- Amount
I then created two more columns called DateBefore (which is the previous day's date) and Change (which is the change from previous day). Please see the screenshots below for the DAX expression for those 2 new columns.
Hope this help!
If I have answered your questions please Accept this post as a solution!
Anonymous
6 years agoNot applicable
Such calculations should be performed in Power Query, not in DAX. Please use the right tool for the job. Thanks.
Best
D
Best
D
Anonymous
6 years agoNot applicable
Anonymous I would beg to differ. There is no written law which says what tool should be used for what calculation. At the end of the day it comes down to personal preference 🙂
- Anonymous6 years agoNot applicableAnonymous, I beg to differ. Calculated columns are never compressed optimally by the SSAS engine, therefore if you want to get the best of your model in terms of space and speed, you'd better use Power Query.
What's more, DAX has no concept of order whereas Power Query, the M language, does. Hence calculations like yours should be performed in PQ.
Best
D- Anonymous6 years agoNot applicableAnd... of course, DAX is a Data eXpression Analysis language, not data mashup language. And what this is trying to do is re-shaping/enriching data.
Best
D