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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
leecity215
New Member

Condition formula to return a value from a different column

Hi everyone,

 

PowerBI newb here as you are about to see.

 

In my model data mode i have two seperate tables (shown below).

 

What i am trying to do is based on the column "Count" in Table A return results from Table B "ME Hours" and "Unit Numbers" based on the "Count" column and where the result from a given row sits in the "Max Integrations" column.

 

For example, May' 24 "Count" is 800. I would like to create a measure that returns 250 ME hours from Table B, as my value from Table A is above 750 Intregations but below 1000. 

 

Any guidance you can provide on how best to structure this would be most appreciated.

Thanks

 

Lee

 

Table A:

TowerDateCount
Tech ServicesJan-24500
Tech ServicesFeb-24575
Tech ServicesMar-24650
Tech ServicesApr-24725
Tech ServicesMay-24800
Tech ServicesJun-24875
Tech ServicesJul-24950
Tech ServicesAug-241025
Tech ServicesSep-241100
Tech ServicesOct-241175
Tech ServicesNov-241250
Tech ServicesDec-241325

 

Table B:

Contract NameTowerDateME HoursLot TypeUnit NumbersMax Integrations
Integration_Management_ServicesTech Services01/01/2024 125Incidents600500
Integration_Management_ServicesTech Services01/01/2024188Incidents900750
Integration_Management_ServicesTech Services01/01/2024250Incidents13801000
Integration_Management_ServicesTech Services01/01/2024313Incidents18751250
Integration_Management_ServicesTech Services01/01/2024375Incidents22501500
4 REPLIES 4
Wilson_
Super User
Super User

Hi leecity215,

 

If you're trying to add a calculated column to TableA, try:

ME Hours =
VAR Filtered =
FILTER (
    TableB,
    TableB[Max Integrations] >= TableA[Count]
)
VAR Result =
MINX (
    Filtered,
    TableB[ME Hours]
)

RETURN Result

 

----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

 

P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.




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

Proud to be a Super User!





Hi there, this worked really well. The only issue is that it only returned a result for one row of data, the first row? Could it be because in table B in my model i am just showing the year whereas in table i am showing a long dat format dd/mm/yyyy? Thank you very much for your help. 

Anonymous
Not applicable

@Wilson_ Thanks for your contribution on this thread.

Hi @leecity215 ,

It will return the expected result after creating the calculated column in table A which provide by @Wilson_ , please check the below screenshot. What do you mean that it only returned a result for one row of data, the first row? Could you please provide more sample data and expected result with the logic and specific examples? It is better if you can provide the sample pbix file(exclude the sensitive info) just as suggested by @Wilson_ . Thank you.

How to upload PBI in Community

vyiruanmsft_0-1713422838892.png

Best Regards

leecity,

 

Can you please share a sample pbix file? (If you don't know how, please check the pinned thread in the forum.) It would make debugging your issue easier. 🙂




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

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors