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
skumar0105
Helper II
Helper II

How to compare 02 dates from different tables with +1 day delta in one of the date

Hi Team,

I have a software which is used to investigate and record the root cause of errors made in the process or system at my company. There is a ML model developed to assist the investigator to find root cause in a quick time.

The model output is shown in a Power BI dashboard. it is neccassary to view the dashboard on the same day he is doing the entries in software. now to monitor the adherence of the dashboard, i want to create another report where in i just want to make sure that the person doing the entries in software is refereing to the Model output dashboard or not. 

 

So here i am comparing 02  dates from 02 different tables, i.e. ML Model output table and the inbuilt Usage metrics report table.

if i compare both dates from both tables, then the problem i am facing is that the inbuilt Usage Metrics report table is refreshed on next day, hence i am not able to get accurate and exact results from the comparison.

i have created 02 measures for this:

Measure = IF(SELECTEDVALUE(Comp_closed_dev[Date_Of_Initiation])=SELECTEDVALUE(User_Plant_Mapping[Date]),TRUE(),FALSE())
Adherence = IF([Measure]=TRUE(),0,1)
 
but it is not correct.
hence i need a DAX query to add +1 day delta in my Usage Metrics report table i.e. User_Plant_Mapping[Date].
 
can anyone help me how to add delta in my query.
Any other approach/idea to monitor the adherence would be most welcome.
 
Thanks in advance.
 
Satish
5 REPLIES 5
skumar0105
Helper II
Helper II

Hi @lbendlin 

Please find below sample data and expected output:

Table 1

Error IDLocationDate of Initiation
11A101.10.2022
22A230.08.2022
33A326.08.2022
44A225.08.2022
55A323.08.2022
66A120.08.2022
77A415.08.2022
88A519.08.2022
99A120.08.2022

 

Table 2:

Dashboard report ViewLocationDate of View
2A102.10.2022
3A201.10.2022
1A327.08.2022
4A226.08.2022
2A324.08.2022
3A121.08.2022
1A420.08.2022
3A514.08.2022
2A122.08.2022

Expected result:

Location% AdherenceRemarks for understanding purpose only
A11next day view, hence should return 1 as a match
A21next day view, hence should return 1 as a match
A31next day view, hence should return 1 as a match
A4005 days gap in view, hence should return 0 as a match
A50No match in date, hence should return 0
A1002 days gap in view hence should return 0

 

Please let me know if this makes sense for you.

 

 

Regards

Satish

How do you correlate the dashboard view event to the error ID?  From our sample data it is not clear how a dashboard view event should be attributed to the error instance.

i am comparing both tables based on the Location column.

That is not good enough, it leads to ambiguity, especially for A1.

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

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