Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
HI , in my dataset ,im having setup columns S1,S2,S3,S4,...upto S12.and date column - first day of every month (1/1/2018 to 12/1/2022) and field values . I need previous row difference of each rows .but first row of each setup should be null or zero (it should not take difference of previous set ups) for example s2 should not take the field values of s1. so that particular row should be zero or null. and in difference i have to use ABS dax function to avoid negative sign in output column.
kindly see the data set.please help me out. vry thankfull for your help
help me plzzzz
Solved! Go to Solution.
try to add a column with this:
please try
Difference =
VAR CurrentDate = TableName[Date]
VAR CurrentValue = TableName[Value]
VAR CurrentSetupTable =
CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[Setup] ) )
VAR PreviousRecords =
FILTER ( CurrentSetupTable, TableName[Date] < CurrentDate )
VAR PreviousRecord =
TOPN ( 1, PreviousRecords, TableName[Date] )
VAR PreviousValue =
COALESCE ( MAXX ( PreviousRecord, TableName[Value] ), CurrentDate )
RETURN
ABS ( CurrentDate - PreviousValue )
try to add a column with this:
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 17 | |
| 8 | |
| 7 | |
| 6 |