Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 | 1451 | abril | 4 | 186 |
Argentina | 1451 | abril | 5 | 0 |
Argentina | 1554 | abril | 6 | 103 |
Argentina | 1628 | abril | 7 | 74 |
Argentina | 1715 | abril | 8 | 87 |
Argentina | 1795 | abril | 9 | 80 |
i need to create the column "casos por dia" in power bi con dax, the column must be a daily grow, so the difference between a day and the day before, must work for many countrys , months and year, the date can be change to any format.
i need to do it in dax to publish in power bi, the data come from the cloud
Solved! Go to Solution.
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:
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 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 🙂
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:
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!
thanks for the answer, at the end i solve it by power query, duplicating the table then creating another column with the day before and the data of the day before then using the difference in another column , your solution is more elegant.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
46 | |
22 | |
20 | |
15 | |
13 |
User | Count |
---|---|
49 | |
41 | |
39 | |
19 | |
19 |