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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
SteelChampzz
Helper II
Helper II

Multiple Two Columns then return an IF statement

I want to use this EXCEL formula in Power BI

 

"=IF(O2>0,O2*M2,M2)" or "=IF(P2>0,J2*P2,"")"

 

So lets say O2 & P2 are "Quanities"    M2 & J2 are "Units"

I want to make sure that those number value are greater than 0, then "quanity*Unit"

 

I'm not sure if I should be using the IF function in this scenario in Power Query or CALCULATE measure with a FILTER?

 

Thanks for the help

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @SteelChampzz,

AFAIK, the current power bi data model table does not include the row and column index.
So if you want to calculate with specific row records, please add an index field in the table as a condition to help DAX expressions find the corresponding records to calculate.

Add an index column (Power Query) (microsoft.com)

If you only mean to calculate values based on condition, you can add a calculated column to the table:

Column formula =
IF ( Table[Column1] > 0, Table[Column1] * Table[Column2], Table[Column2] )

BTW, current power bi does not support creating dynamic calculated columns/tables based on filter effect. They are working on different levels and you can't use the child level to affect their parent.

Regards,

Xiaxoin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @SteelChampzz,

AFAIK, the current power bi data model table does not include the row and column index.
So if you want to calculate with specific row records, please add an index field in the table as a condition to help DAX expressions find the corresponding records to calculate.

Add an index column (Power Query) (microsoft.com)

If you only mean to calculate values based on condition, you can add a calculated column to the table:

Column formula =
IF ( Table[Column1] > 0, Table[Column1] * Table[Column2], Table[Column2] )

BTW, current power bi does not support creating dynamic calculated columns/tables based on filter effect. They are working on different levels and you can't use the child level to affect their parent.

Regards,

Xiaxoin Sheng

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.