Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I am trying to use Power Query to give me the difference between consecuvtive start times in the table below. The second row "Start Time" needs to move to the first row of a new column. How do I do this? I tried using index function and using the following code: {[Index]+1}[Start Time] but I get the following error message :
Expression.Error: We cannot apply field access to the type List. Details: Value=[List] Key=S
What is a good work around for this?
Solved! Go to Solution.
Hi @scruffychain ,
You can also consider using Dax to solve this problem
Here are the steps you can follow:
1. In Power query, Add Column – Index Column – From 1.
2. Create calculated column.
New_Date =
var _1=CALCULATE(SUM('Table'[date]),FILTER(ALL('Table'),'Table'[Index]=EARLIER('Table'[Index])+1))
return
IF(
ISBLANK(_1),BLANK(),_1)
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @scruffychain ,
You can also consider using Dax to solve this problem
Here are the steps you can follow:
1. In Power query, Add Column – Index Column – From 1.
2. Create calculated column.
New_Date =
var _1=CALCULATE(SUM('Table'[date]),FILTER(ALL('Table'),'Table'[Index]=EARLIER('Table'[Index])+1))
return
IF(
ISBLANK(_1),BLANK(),_1)
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Add two index columns, first idex columns start from 1 and second one start from 0, then mege the table with it self and select the 1st and 2nd column:
then expand the column and selec the start date:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
{[Index]+1} is just a list containing a single number, which doesn't have an associated field [Start Time].
You might be interested in my answer on StackOverflow or a recent post here:
https://community.powerbi.com/t5/Desktop/Calculating-Daily-values-from-Cumulative-Total/m-p/2198969
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
25 | |
18 | |
17 | |
17 | |
14 |
User | Count |
---|---|
29 | |
27 | |
18 | |
14 | |
13 |