Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
hello
i am new to power bi , and i have some struggle with this.
my data look like this (small portion:)
DATE / sum
2018-07-01 / 200
2017-09-03 / 400
2016-19-04 / 500
i want to calculate the difference between those dates , so i want to create new column:
DATE / sum / new column
2018-07-01 / 200 / 400
2017-09-03 / 400 / 500
2016-19-04 / 500 /
only problems on the data sets:
1. dates are not strictly consecutive , meaning i can have 5 dates in 2018 and 10 dates in 2017
2. i want those calculation to be filtred by the user. meaning - if user deselect the '2017-09-03' date , then calculation will changed to the following:
DATE / sum / new column
2018-07-01 / 200 / 500
2016-19-04 / 500 /
thanks.
Solved! Go to Solution.
Hi all,
i manged to solve this using this answer:
basicly i had to calculate for each date the previous date (under the current filters) and then return the result for that date
Hi @ellevy12,
Please provide a sample of the original data. Since the dates aren't in order by dates, how can we determine which one is former, which one is latter?
Best Regards,
Dale
Hi all,
i manged to solve this using this answer:
basicly i had to calculate for each date the previous date (under the current filters) and then return the result for that date
Thanks for sharing, @ellevy12.
Best Regards,
Dale
Up until that last requirement, you could have just used a calculated column with EARLIER.
Now, you will need a measure and use a VAR to grab your current table (as filtered by user). Then, use ADDCOLUMNS to add a column using EARLIER to that table and do your calculations.
Here is an article on the use of EARLIER:
See my article on Mean Time Before Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...
sorry i think i mix things up.. actualy what i reffered to as my data is actualy a visual matrix / table based on the data.
does this change somthing ?
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
You cannot do this by using a Calculated Column but you can do it using a Measure. Is a measure ok? Also can you include in the dataset you have provided any column that is relevant for the calculation
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 38 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 66 | |
| 29 | |
| 26 | |
| 25 |