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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
vacuesta
Helper I
Helper I

Replicate a Calculation from Excel in PowerBI

Hi. I am looking for user advice to replicate a vlookup type calculation that is happening in excel to POWER BI :   =IF(LOOKUPVALUE(Circuit_Speeds[BW/Speed Validated 3/5],Circuit_Speeds[CPE IP],WAN_Utilization[IP])>0,LOOKUPVALUE(Circuit_Speeds[BW/Speed Validated 3/5],Circuit_Speeds[CPE IP],WAN_Utilization[IP]),WAN_Utilization[ifHighSpeed])

 

Circuit speeds is a spreadsheet and WAN_Utilization is another spreadsheet. I believe there is a relationship betwen CPE IP and the IP attributes within the two different tables.

 

Any advice on replicating this exact calculation in POWER BI? It is supposed to calculate a new column. 

 

Thanks.

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi @vacuesta ,

 

You can create column like DAX below.

 

Column1 =
VAR d =
    CALCULATE (
        FIRSTNONBLANK ( Circuit_Speeds[BW/Speed Validated 3/5], 1 ),
        FILTER (
            ALLSELECTED ( Circuit_Speeds ),
            Circuit_Speeds[CPE IP] = WAN_Utilization[IP]
        )
    )
RETURN
    IF ( d > 0, d, WAN_Utilization[ifHighSpeed] )

 

Best Regards,

Amy

 

Community Support Team _ Amy

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

I tried these 2 which are relatively the same:

= VAR d = CALCULATE(FIRSTNONBLANK(CID[BW/Speed Validated 3/5],1),FILTER(ALLSELECTED(CID), CID[CPE IP]=interface_list[ip])) RETURN IF(d>0, d, interface_list[ifHighSpeed])

 

=IF(LOOKUPVALUE(CID[BW/Speed Validated 3/5],CID[CPE IP],interface_list[ip])>0,LOOKUPVALUE(CID[BW/Speed Validated 3/5],CID[CPE IP],interface_list[ip]),interface_list[ifHighSpeed])

 

I am getting an error for both saying: "DAX xomparison operations do not support comparing values of type Text with values of type inteer. Consider using the VALUE or FORMAT function to convert one of the values."

 

For a bit of background info the 'ifHighSpeed' and ' BW/Speed Validated 3/5' is a numeric value; however, 'CPE IP' and 'IP' are string IP addresses. The number that is returned per row is a Numberic value though. 

 

Do you recommend how to go about this issue?

vacuesta
Helper I
Helper I

Update: I have the 2 tables already fed into Power BI desktop with a relationship between the two tables for CPE IP and IP. I needed advice and how to go forth with calculating this column with this calculation from excel.

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.