Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi,
I would like to create a column either in DAX or M where the some row are a date from another column and some are the previous row plus an offset, like:
IF(TABLE[INITIAL] = TRUE(); TABLE[CREATED]; DATEADD(TABLE[value from previous row];TABLE[OFFSET]) )
any suggestions are appriciated
Solved! Go to Solution.
Hi @eacy,
Yes, we can achieve this requirement is Power BI by adding a calculated column. In your scenario, did you encounter any issue when using this formula?
In DAX you can’t reference the previous row in any way because there is no order to the rows, So fi you need to get previous row, you can create a rank column, and then use LOOKUPVALUE function to get it.
Rank = RANKX('TABLE','TABLE'[ID],,1)
Previous = LOOKUPVALUE('TABLE'[CREATED],'TABLE'[Rank],'TABLE'[Rank]-1)
Column = IF('TABLE'[INITIAL]=1,'TABLE'[CREATED],DATEADD('TABLE'[Previous],'TABLE'[OFFSET],DAY))
Reference
Regards,
Charlie Liao
Hi @eacy,
Yes, we can achieve this requirement is Power BI by adding a calculated column. In your scenario, did you encounter any issue when using this formula?
In DAX you can’t reference the previous row in any way because there is no order to the rows, So fi you need to get previous row, you can create a rank column, and then use LOOKUPVALUE function to get it.
Rank = RANKX('TABLE','TABLE'[ID],,1)
Previous = LOOKUPVALUE('TABLE'[CREATED],'TABLE'[Rank],'TABLE'[Rank]-1)
Column = IF('TABLE'[INITIAL]=1,'TABLE'[CREATED],DATEADD('TABLE'[Previous],'TABLE'[OFFSET],DAY))
Reference
Regards,
Charlie Liao
Hi Charlie Liao,
Thanks, this sound plausible, I will try to see if I can find the time to test this today.
User | Count |
---|---|
66 | |
60 | |
47 | |
33 | |
32 |
User | Count |
---|---|
87 | |
72 | |
56 | |
49 | |
45 |