Forum Discussion

jbrines's avatar
jbrines
Advocate III
7 months ago
Solved

Lookup help

Hi guys,

 

I am converting an excel spreadsheet (below) in to Power BI.

 

 

 

I have a Table names SLATime which is a list categories with an SLA Time for each category. I want to create a messure (SLA Met) that will lookup the SLATime table and compare it to the existing category in the results table then subtract the actual time from the SLATime and if it is positive then Produce Yes and if it is negative then Produce a No. Currently in the spreadsheet I am having to use multiple colums to do this. Is it possible and if yes what would the DAX formula be?

 

  • jbrines Here is the final PBIX with the correct logic.

     

    BBF


    πŸ’‘ Did I answer your question? Mark my post as a solution!

    πŸ‘ Kudos are appreciated

    πŸ”₯ Proud to be a Super User!

18 Replies

  • jbrines Hi! Can you share the pbix file with tables? or paste data so that i can copy them directly?

     

    Thx

    BBF


    πŸ’‘ Did I answer your question? Mark my post as a solution!

    πŸ‘ Kudos are appreciated

    πŸ”₯ Proud to be a Super User!

    • jbrines's avatar
      jbrines
      Advocate III

      Hi BeaBF 

       

      Results data

       

      TicketSubjectCreated DateClosed Datecreated_byOwnerCategorySub-CategoryActual Time
      IT-22865Force Check In02/11/2025 17:3403/11/2025 07:35Shannon KellyJonathon HewittPIMForce Check In0
      IT-22866Suspicious Email Reported by03/11/2025 07:2203/11/2025 08:49Ian StewartScott YoungSuspicious EmailGenuine0
      IT-22867PIM NOT WORKING03/11/2025 07:3803/11/2025 09:12Macauley WilsonJonathon HewittPIMLocal File Management0.025
      IT-22868Suspicious Email Reported by03/11/2025 07:5703/11/2025 09:07Barry McAulayScott YoungSuspicious EmailPhishing Test0.014583333
      IT-22869Access to site sign in03/11/2025 08:2103/11/2025 08:33Georgie ChisholmJohn BrinesSoftwareMicrosoft Teams0

       

      SLATime Data

       

      CategorySum of Time (days)
      Account Lockout0.042
      BT Cloud Phone0.5
      Business Central3
      Cisco Duo0.042
      Conquest1
      Desk Move2
      Dime3
      Door Cards1
      Email0.5
      Email Photo Update2
      Folder Access1
      FortiClient0.5
      GDPR Delete1
      Hardware - Office1
      Hardware - Site3
      Internet1
      Jet1
      Laptop Build5
      Mailbox Access1
      Mobile Phone - Office2
      Mobile Phone - Site3
      Net 2 Access Control0.5
      New Email Address1
      Password Reset0.042
      PIM1
      Printer1
      Software1
      Spam Issue0.084
      Suspicious Email0.084
      User Account Change1

       

       

      • ryan_mayu's avatar
        ryan_mayu
        Super User

        how to turn SLATime Data into result data? could you pls elaborate more on this ?

        pls provide the sample data and the expected output based on the sample data you provided

  • Best option would be creating your model in star-schema(create DimCategory and create relations from dim to Fact tables) and then usign the measure below:

     

    SLA Met =
    IF(
        SELECTEDVALUE(Results[Actual Time])
            <= SELECTEDVALUE(SLATime[SLA Time]),
        "Yes",
        "No"
    )

     

  • I also menat to say that Actual Time in Power BI is a measure between Created Date and Closed date using NETWORKDAYS

    • v-echaithra's avatar
      v-echaithra
      Community Support

      Hi jbrines ,

      This is possible, and you do not need multiple columns like in Excel.
      The key is to model it correctly and use a measure-to-measure comparison.


      Create a Category dimension

      Create a DimCategory table containing distinct Category


      Results[Category] > DimCategory[Category]

      SLATime[Category] > DimCategory[Category]

      This creates a proper star schema, which is required for clean DAX.

      Keep Actual Time as a measure
      Since Actual Time is already a measure (calculated using NETWORKDAYS), that’s perfectly fine.

      Create an SLA Time measure

      SLA Time =
      SELECTEDVALUE ( SLATime[Sum of Time (days)] )


      Create the SLA Met measure

      SLA Met =
      IF (
      [Actual Time] <= [SLA Time],
      "Yes", "No")

      If possible, could you please provide more details about your data?

      How to provide sample data in the Power BI Forum

      You can refer the following link to upload the file to the community.
      How to upload PBI in Community

      Thank you.

      • jbrines's avatar
        jbrines
        Advocate III

        Hi v-echaithra , Sorry I don't have a lot of experinec with Power BI especially Dimentions.

         

        Create a Category dimension - Is this a new Dimention Table called Category?

        Create a DimCategory table containing distinct Category - My SLATime Data table contains distinct Categories.

         

        Is there a way I can send you the pbix so you can then show me what you mean?