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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
fish123
Frequent Visitor

Return a column based on measure condition

I have two measues to caluculate the running total of Sales order qty and PO qty. Im gonna retune the column that show the smallest date that RT PO qty can cover SO qty. For example, i try to get 2021-02-02 as the date that the running total of SO qty is 20. 

fish123_0-1611615586389.png

 

I used the following formuale. but it doesnt work.

ETA For each SO =
MINX(filter(ALLSELECTED('PO by Item'),'SO by Item'[RT Item SO Qty]<='PO by Item'[RT Item PO Qty]),'PO by Item'[PO ShipDate])

 

I tried to use lookupvalue, but doesnt work either, part of the reason i guess is RT SO qty and RT PO qty are not columns. 

 

Could you please advise any change? Thanks in advance!

3 REPLIES 3
Anonymous
Not applicable

Hi @fish123 ,

 

Is there a relationship between your two tables?

Try to delete the relationship and see if it succeeds.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@fish123 , if you are trying to create a column and use a measure for that. That will not work.

 

You have to create a new measure only.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

yep, i tried to created a new measure, but i didnt figure out the issue of my formular.

ETA For each SO =
MINX(filter(ALLSELECTED('PO by Item'),'SO by Item'[RT Item SO Qty]<='PO by Item'[RT Item PO Qty]),'PO by Item'[PO ShipDate])

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors