Forum Discussion
Upali63
2 years agoHelper II
Create New Column with Data from Same table
Hi Friends I have a data table as per sample below where the values in Amount Column alwayas show on accumulated basis as at end of each month. Now I want to create a new coloum subtracting curre...
Anonymous
2 years agoNot applicable
Open your Power BI Desktop file.In the Fields pane on the right-hand side, select your data table.In the Modeling tab, click on "New Column."In the formula bar that appears at the top, you can use the DAX formula to create the new column. You can use the LAG function to retrieve the value from the next month and subtract it from the current month's value. Here's an example formula :
NewColumn = YourTable[Amount] -
CALCULATE(SUM(YourTable[Amount]),
FILTER(YourTable, YourTable[Month] = EARLIER(YourTable[Month]) + 1)
)