cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bsaragadam
Helper I
Helper I

Need help in DAX

 

Hello Team,


We have Exporting the Audit logs into the SQL Database and We are trying to get the list of reports/datasets/dataflows/dashboards not being access for 180 days based on last creation time of the record, Activity type from the audit logs database.

 

 

Problem scenario

  1. We are able to get the list of the reports/dataset not been accessed for 180 days.
  2. If the report/dashboard gets deleted by the developer or someone and there will be separate record in the delete dataset Activity.
  3. We are trying to get the data in the table visual which contains the report name and dataset name workspace name which is still existing and not been access and deleted for 180 days.
  4. Need help to achieve the logic using DAX or M-query

Your help will be appreciated!!

 

Table data 

DatasetNameWorkSpaceNameEarliest CreationTime max per DatasetNameActivity
Admin Tools _OriginalProject Online PowerBI Reports9/6/2019 17:07DeleteDataset
Admin Tools 550Project PowerBI 9/6/2019 17:07DeleteDataset
HR DashboardAnalytics9/11/2019 19:43DeleteDataset
HR Dashboard V2Analytics9/10/2019 23:46DeleteDataset
HR DashboardAnalytics9/11/2019 19:43ViewReport
HR Dashboard V2Analytics9/10/2019 23:46ViewReport
Admin Tools _OriginalProject PowerBI 9/6/2019 16:23ViewReport


Expected Table data 

DatasetNameWorkSpaceNameEarliest CreationTime max per DatasetNameActivity
Admin Tools 550Project Online PowerBI Reports9/6/2019 17:07DeleteDataset



Expected Table 

Thank you

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@bsaragadam 

You can see the names that no activity and more than 180 days until now with the following:

 

Column = IF(DATEDIFF([Earliest CreationTime max per DatasetName],TODAY(),DAY)>180 && [Activity]<>"DeleteDataset" && [Activity] <>"View Report", TRUE(),FALSE())

 

 

Then you can drag the columns into a table visual and filter with the this flag column to show the rows that matches the condition.

 

Paul Zheng
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

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@bsaragadam 

You can see the names that no activity and more than 180 days until now with the following:

 

Column = IF(DATEDIFF([Earliest CreationTime max per DatasetName],TODAY(),DAY)>180 && [Activity]<>"DeleteDataset" && [Activity] <>"View Report", TRUE(),FALSE())

 

 

Then you can drag the columns into a table visual and filter with the this flag column to show the rows that matches the condition.

 

Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

I did not get it completely. But you can have flag-like

flag = if(datediff(	[Earliest CreationTime max per DatasetName], today(), day)>180 &&  [Activity]="DeleteDataset" ,1, 0)

 



New Power BI Features
Datamarts: https://youtu.be/8tskWsJTEpg
Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin !! Proud to be a Super User!
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
!! Subscribe to my youtube Channel !!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors