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
TessGaston
Regular Visitor

How to connect data with exact time in one dataset to a time range in other dataset

Hello,
please could somebody help me with my problem?

I have many XML files with call logs and one excel file with attendance of operators.

XML file contains ID of the phone, date of the call and some other stuff.

Excel file contains ID of the phone, date of the attendance of the operator, time from, time to (when the operator started and finished work that day) and the operator's name.

What I need is to add a new column in the XML files in Power BI and type in the name of the operator who managed the call. So it should search somehow the ID of the phone with the date and then check if the time is older or equal to the time "from" and simultaneously that the time is younger or equal to the time "to", if everything meet the conditions, than it should type in the column "name" the name from the row which met the conditions.

Is that possible in Power BI somehow? I hope it is because I need to automatize this process fullfully (with no manual step like preparing CSV files) so I would be able to create reports from the data.

Thank You!!!

Tereza

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @TessGaston

 

You may use SELECTEDVALUE Function. Show you an example as below:

 

Measure =
MINX (
    FILTER (
        Excel,
        SELECTEDVALUE ( XML[Time] ) > Excel[Start]
            && SELECTEDVALUE ( XML[Time] ) < Excel[End]
    ),
    Excel[Name]
)

Untitled.png

 

Column =
MINX (
    FILTER ( Excel, XML[Time] > Excel[Start] && XML[Time] < Excel[End] ),
    Excel[Name]
)

Regards,

Cherie

Community Support Team _ Cherie Chen
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

1 REPLY 1
v-cherch-msft
Employee
Employee

Hi @TessGaston

 

You may use SELECTEDVALUE Function. Show you an example as below:

 

Measure =
MINX (
    FILTER (
        Excel,
        SELECTEDVALUE ( XML[Time] ) > Excel[Start]
            && SELECTEDVALUE ( XML[Time] ) < Excel[End]
    ),
    Excel[Name]
)

Untitled.png

 

Column =
MINX (
    FILTER ( Excel, XML[Time] > Excel[Start] && XML[Time] < Excel[End] ),
    Excel[Name]
)

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.