cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
sowmya2553 Frequent Visitor
Frequent Visitor

Create a date column by SP upload date and Device Weekly Trend which are added newly

Hello Team, Need help to identify how many systems are newly added for every week Here is below sample. I need to create one column which can tell me if the device is repeated or newly added. Please help.

Device Week Trend.JPG

 

 

Also I have a second query. I have a data dump which doesn't have any date field and it only has system devices, model type and OS name fields. File will be uploaded in sharepoint where I will fetch the worksbook from sharepoint link into power BI I want to create a new column inside power BI which can display the upload date into one single column for the entire dataset. For example as below

Upload Date SP.JPG

Kindly help.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Create a date column by SP upload date and Device Weekly Trend which are added newly

Hi @sowmya2553 ,

 

One sample for your reference, please check the following steps as below.

1. For the first query, We can create a calculated column as below.

Newly added = 
VAR a =
    CALCULATETABLE (
        VALUES ( 'Table'[Serial Number] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Week Number] <> MAX ( 'Table'[Week Number] ) )
    )
RETURN
    IF ( NOT ( 'Table'[Serial Number] IN a ), "new added", "repeated" )

new.PNG

2. Insert index columns in both tables in power query.

Capture.PNG

 

3. Based on the index column, we can use LOOKUPVALUE function here.

Upload = 
LOOKUPVALUE (
    'Table'[Date],
    'Table'[Index], 'Table (2)'[Index],
    'Table'[Serial Number], 'Table (2)'[Serial Number]
)

upload.PNG

 

For more details, please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

danextian New Contributor
New Contributor

Re: Create a date column by SP upload date and Device Weekly Trend which are added newly

You can try connecting to a Sharepoint Folder instead of the actual file. The process is very similar with connecting a folder locally or via network shares.  With SP folder, you have to connect to the root folder and filter it to the folder you want to connect to. This way the metadata of the files in that folder will be available to you. This is a sample PQ of connecting to OneDrive for Business/Personal Sharepoint.

let
    Source = SharePoint.Files("https://tenant-my.sharepoint.com/personal/user/", [ApiVersion = 15]),
    #"Filtered Rows" = Table.SelectRows(Source, each ([Folder Path] = "https://tenant-my.sharepoint.com/personal/user/Documents/Subfolder1/Subfolder2/"))
in
    #"Filtered Rows"

 

 

"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Create a date column by SP upload date and Device Weekly Trend which are added newly

Hi @sowmya2553 ,

 

One sample for your reference, please check the following steps as below.

1. For the first query, We can create a calculated column as below.

Newly added = 
VAR a =
    CALCULATETABLE (
        VALUES ( 'Table'[Serial Number] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Week Number] <> MAX ( 'Table'[Week Number] ) )
    )
RETURN
    IF ( NOT ( 'Table'[Serial Number] IN a ), "new added", "repeated" )

new.PNG

2. Insert index columns in both tables in power query.

Capture.PNG

 

3. Based on the index column, we can use LOOKUPVALUE function here.

Upload = 
LOOKUPVALUE (
    'Table'[Date],
    'Table'[Index], 'Table (2)'[Index],
    'Table'[Serial Number], 'Table (2)'[Serial Number]
)

upload.PNG

 

For more details, please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

sowmya2553 Frequent Visitor
Frequent Visitor

Re: Create a date column by SP upload date and Device Weekly Trend which are added newly

Hello There,

 

Thank you very much for the quick help.

It worked 🙂

However my last query regarding the second query is as below.

For suppose the below table is the only single table which I have and it doesn't hold any date columns in the entire table.

and this excel file gets uploaded in share point. Power BI should fetch whatever is the upload date/time in SP (last modified date) into one single column as shown below second sample table.

Please suggest.

 

 

Your below second qery helped in giving the relation to other tables where the date column is already available in one of the tables. But I am looking for the date column to be created automatically and fetch whataver is the upload date in SP.

danextian New Contributor
New Contributor

Re: Create a date column by SP upload date and Device Weekly Trend which are added newly

You can try connecting to a Sharepoint Folder instead of the actual file. The process is very similar with connecting a folder locally or via network shares.  With SP folder, you have to connect to the root folder and filter it to the folder you want to connect to. This way the metadata of the files in that folder will be available to you. This is a sample PQ of connecting to OneDrive for Business/Personal Sharepoint.

let
    Source = SharePoint.Files("https://tenant-my.sharepoint.com/personal/user/", [ApiVersion = 15]),
    #"Filtered Rows" = Table.SelectRows(Source, each ([Folder Path] = "https://tenant-my.sharepoint.com/personal/user/Documents/Subfolder1/Subfolder2/"))
in
    #"Filtered Rows"

 

 

"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)