Forum Discussion
DAX
Based on Date selection my Table is created for the selcted dates.
now i want to add 2 more columns in my table,
first column: Delta of column 1& Column 3 (i.e Delta of 27-1-25 & 3-2-25)
Second column: Delta of column 2& Column 3 (i.e Delta of 2-2-25 & 3-2-25)
I can select different dates based on requirement, but by 2 columns formula will be fixed, i.e colum 3-column1 & column 3-column 2. And my table will have only 3 dates data.
How can i do this?
Hi prashantg364
This one is quite tricky and complex. It involves a disconnected table that contains all possible date combinations of column1 vs. column3 and column2 vs. column3, along with the actual date columns. Additionally, there's another disconnected table for the dates to be compared. It's challenging to explain the process in detail, so please refer to the attached PBIX file for a clearer understanding.
2 Replies
- amitchandakSuper User
prashantg364 , I think visual calculation can help or offset function can help
Assume you are using measure then you can diff for each date like
diff = [Measure]- calculate([Measure], OFFSET(-1, ALLSELECTED('Date'[Date]),ORDERBY('Date'[Date])))
or check Visual Calculations in Power BI- February 2024 Update RUNNINGSUM, RANGE, MOVINGAVERAGE, COLLAPSE, COLLAPSEALL, EXPAND, EXPANDALL, FIRST, LAST, PREVIOUS, and NEXT
https://www.youtube.com/watch?v=bKD9T0EWgQo&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L - danextianSuper User
Hi prashantg364
This one is quite tricky and complex. It involves a disconnected table that contains all possible date combinations of column1 vs. column3 and column2 vs. column3, along with the actual date columns. Additionally, there's another disconnected table for the dates to be compared. It's challenging to explain the process in detail, so please refer to the attached PBIX file for a clearer understanding.