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! Learn more

Reply
NeilJustice
Frequent Visitor

Excel formula into DAX to create calculated column in Power Bi

I have a table with thousands of lines as in the example below.

I want to be able to group the information by InvoiceId column (A) then look at the value in (C)  to return the expected result in column (E), but its proving somewhat difficult to write a DAX statement to provide this information in a new column in power bi, or power query in power bi. Note that in (A) there are multiple id numbers and multiple variations in (C), one rule is that when there are multiple lines with the  same invoiceId and PO or No PO in column (C) then PO will always override No PO. If it is just a single or multiple line in (A) with the same value in (C) then it is true to return that value. Its only when i hit multiple variations in (C) to the same Id in (A) where i cannot get the expected result. I have a formula in excel that seems to work okay in excel table, but cannot convert to a DAX formula. I have provided this below if it helps please?

 

=INDEX($C$1:$C$1000,MATCH(MIN(IF(($A$1:$A$1000=A1)*($C$1:$C$1000<>"No PO"),$D$1:$D$1000)),($D$1:$D$1000)*($A$1:$A$1000=A1)*($C$1:$C$1000<>"No PO"),0))

NeilJustice_0-1693476423368.png

 

 

2 REPLIES 2
technolog
Super User
Super User

I hope this message finds you well. I've noticed that this solution remain unresolved. If any of you have managed to find a resolution to the issue, I kindly request that you share your solution for the benefit of the entire community. Alternatively, if you're still facing challenges, please do let us know as well.

Your insights and updates will greatly assist others who might be encountering the same challenge.

lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.