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
sowmya2553
Helper I
Helper I

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
v-frfei-msft
Community Support
Community Support

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

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"

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

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.

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.

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"

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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
Top Kudoed Authors