Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
scruffychain
Regular Visitor

Expression.Error: We cannot apply field access to the type List. Details: Value=[List] Key=S

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 : 

scruffychain_0-1637609798124.png

 


Expression.Error: We cannot apply field access to the type List. Details: Value=[List] Key=S

What is a good work around for this?

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

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.

vyangliumsft_1-1637808895954.png

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:

vyangliumsft_2-1637808895955.png

 

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

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

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.

vyangliumsft_1-1637808895954.png

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:

vyangliumsft_2-1637808895955.png

 

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

VahidDM
Super User
Super User

HI @scruffychain 

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:

VahidDM_0-1637623893032.png

 

 

then expand the column and selec the start date:

VahidDM_1-1637623934964.png

 

 

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/

 

 

AlexisOlson
Super User
Super User

{[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

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.