Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
The data columns marked in green is the source data and one marked in amber is calculated column in excel. This step needs to be automated in power bi (maybe in power query itself or adding new calculated columns in power BI).
I tried creating the calculated column in power Bi (named output value) but the real challange is using
if function in power bi to refer the previous content of the same column. In excel it works pretty fine since we are able to retain and refer the previous value/cells within the same column.
Any suggestion or DAX to build new column ?
Hi @Anonymous ,
The green columns already exist in the data source? If so, you could refer the following formula to get the previous index value.
pre_name =
var p_index = calculate(max([index]),filter('table',[index]<eariler([index])))
return
calculate(max([name]),filter('table',[index] = [p_index]))
pre_end =
var p_index = calculate(max([index]),filter('table',[index]<eariler([index])))
return
calculate(max([end]),filter('table',[index] = [p_index]))
Then use then in if() function, B13 = [name], B12 = [pre_name], E13 = [end] and E12 = [pre_end].
The thing is calculated column only obtains the value when it is generated, and cannot obtain a value of its own.
In other words, you cannot get the value of H12.
Best Regards,
Jay
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |