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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors