Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jbrines
Helper IV
Helper IV

Lookup help

Hi guys,

 

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

 

jbrines_1-1767789879872.png

 

 

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?

 

14 REPLIES 14
jbrines
Helper IV
Helper IV

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

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.

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?

 

 

 

cengizhanarslan
Solution Sage
Solution Sage

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"
)

 

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn

Hi @cengizhanarslan do you mean like below?

 

jbrines_0-1767799292545.png

 

No, please check the following document

https://learn.microsoft.com/en-us/power-bi/guidance/star-schema

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn
BeaBF
Super User
Super User

@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!

Community News image 1920X1080.png

@BeaBF how do you upload the pbix file?

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

 

 

@jbrines Hi!
Here the calculated column:

FINAL AGGREGATED =
VAR SLA_DAYS =
    LOOKUPVALUE(
        'SLA Time'[Sum of Time (days)],    
        'SLA Time'[Category],              
        'Results Data'[Category]            
    )
VAR DELTA =
    'Results Data'[Actual Time] - SLA_DAYS
RETURN
IF(DELTA > 0, "YES", "NO")

I attack also the pbix file! 🙂
Let me know
BBF

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

👍 Kudos are appreciated

🔥 Proud to be a Super User!

Community News image 1920X1080.png

@jbrines You can also do it without the lookup function, but using relations and RELATED function
I attack the same pbix with the second logic implemented

 

BBF


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

👍 Kudos are appreciated

🔥 Proud to be a Super User!

Community News image 1920X1080.png

Hi,

Based on the 2 tables that you have shared, show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur ,

 

Basically in the mesure column I want it to look at the Category in the results data table, compare it to the Category on Table SLATime Data then use the Sum of Time field to subtract from the Actual Time on the results data table if it is zero or poistive then the outcome should be Yes, if it is a negative the outcome should be No. The Actual Time Column the Results Table in Power Bi is currently a messure column

 

I hope that makes sense.

 

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





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

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.