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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Prompts to Power BI using Python scripts

ppbi error.PNGHi, I am trying to compare software version in 2 columns and return a third column based on the results and in order to do this I am using Python. The script works perfectly fine in Jupyter notebook but it does not works in  PowerBi. Can anyone help me with the issue please. I am attaching screenshot of my data and error. the script is also attached  below:

 

import pandas as pd
import numpy as np

v1 = dataset['Latest Packaged Version'].fillna('').tolist()
v2 = dataset['Version'].fillna('').tolist()

def converter_list(version_list):


v12 = list()
for i in version_list:

temp = i.replace(".", "")
temp1 = ""
zero_flag = 0
for j in reversed(range(0, len(temp))):
if(temp[j] == '0'):
zero_flag = 1
temp1 = temp[j]
else:
break
if(zero_flag):
temp1 = temp

if(temp1 == ""):
temp1 = "0"

v12.append(int(temp1))

return (v12)

def compare_list(list1, list2):
temp_list = list()
for i, j in zip(list1, list2):
if i >= j:
temp_list.append(False)
else:
temp_list.append(True)

return temp_list


v1_int = converter_list(v1)
v2_int = converter_list(v2)

version_check_list = compare_list(v1_int, v2_int)

dataset['res'] = version_check_list

pbif.PNG

1 ACCEPTED SOLUTION

@Anonymous ,

 

Please import the csv to power bi at first. Then implement the python script. The script works well on my side.

Capture.PNG 

Community Support Team _ Jimmy Tao

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

View solution in original post

8 REPLIES 8
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

I have made a test on my side, but your python script works well on my side. I have formatted your code as below:

# 'dataset' holds the input data for this script

import pandas as pd

v1 = dataset['Latest Packaged Version'].fillna('').tolist()
v2 = dataset['Version'].fillna('').tolist()

def converter_list(version_list):
    v12 = list()
    for i in version_list:
        temp = i.replace(".", "")
    temp1 = ""
    zero_flag = 0
    for j in reversed(range(0, len(temp))):
        if(temp[j] == '0'):
            zero_flag = 1
            temp1 = temp[j]
        else:
            break
    if(zero_flag):
        temp1 = temp
    if(temp1 == ""):
        temp1 = "0"
    v12.append(int(temp1))
    return (v12)

def compare_list(list1, list2):
    temp_list = list()
    for i, j in zip(list1, list2):
        if i >= j:
            temp_list.append(False)
        else:
            temp_list.append(True)
    return temp_list

v1_int = converter_list(v1)
v2_int = converter_list(v2)

version_check_list = compare_list(v1_int, v2_int)

dataset['res'] = pd.Series(version_check_list)

2.PNG 

 

So if your issue still persists, I think it's related to your data source. Please check if the value in [Version] or [Latest Packaged Version] are text type after imported in power bi.

 

Community Support Team _ Jimmy Tao

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

 

Anonymous
Not applicable

Thanks a lot for the prompt revert. I wasted so much time to figure this out but all went in vain. I have made changes to the script. Could you please help me with the new script? i would be very thankful to you.

 

Also, when I tried executing your code it gave me the result attached with this message.pbi23.PNG

import pandas as pd

v1 = dataset['Latest Packaged Version'].fillna('').tolist()
v2 = dataset['Version'].fillna('').tolist()

 

def change_string_to_ascii(v12):

fin_list = []
for i in v12:
if(i.isdigit()):
fin_list.append(i)
else:
#print(i)
fin_list.append((ord(i))

#fin_str = "".join(fin_list)
return fin_list


def compare_list(list1, list2):
result_list = []
for i,j in zip(list1, list2):
if (i == "" or j == ""):
if(i == ""):
result_list.append("Upgraded")
else:
result_list.append("Not Upgraded")
continue

if(len(i) > len(j)):
result_list.append("Not Upgraded")
continue
elif(len(i)< len(j)):
result_list.append("Upgraded")
continue

else:

i_arr = i.split(".")
j_arr = j.split(".")

i_arr_dl = change_string_to_ascii(i_arr)
j_arr_dl = change_string_to_ascii(j_arr)

count = 0
for i_val, j_val in zip(i_arr_dl, j_arr_dl):
count+=1
if(i_val > j_val):
result_list.append("Not Upgraded")
break
elif(i_val == j_val):
#print(count, len(i_arr))
if(count == len(i_arr)):
#print("added")
result_list.append("Upgraded")
else:
continue
elif(i_val < j_val):
result_list.append("Upgraded")
break
return result_list

 

version_check_list = compare_list(v1, v2)

 

dataset['res'] = pd.Series(version_check_list)

@Anonymous ,

 

What's the issue? Could you clarify more details about the issue or requirement and share some sample data/sample file?

 

Regards,

Jimmy Tao

Anonymous
Not applicable

Hi Jimmy,

 

I am still not able to run the file. I am attaching the error snap along with some sample data for you. Thank you again.

 

Sample Data:

 

_ResourceGuidDisplayNameSoftwareProductInstallDateVersionLatest Packaged Version
19b65d1a-54ab-46ca-8fba-0003dd6f492fMicrosoft Office 365 ProPlus - en-usMicrosoft Office 365 ProPlus 20165/19/2019 0:0016.0.10730.2026416.0.8431.2250
19b65d1a-54ab-46ca-8fba-0003dd6f492f7-Zip 19.00 (x64 edition)7-Zip6/10/2019 0:0019.00.00.018.06.00.0
19b65d1a-54ab-46ca-8fba-0003dd6f492f7-Zip 19.00 (x64 edition)7-Zip6/10/2019 0:0019.00.00.018.06.00.0
949b9d33-8922-4392-a808-0004281523c8Cb Defense Sensor 64-bitCarbon Black Defense Sensor 33/11/2019 0:003.2.1.513.2.1.51
949b9d33-8922-4392-a808-0004281523c8Cb Defense Sensor 64-bitCarbon Black Defense Sensor 33/11/2019 0:003.2.1.513.2.1.51
949b9d33-8922-4392-a808-0004281523c8Google Earth ProGoogle Earth Pro3/29/2019 0:007.3.2.57767.1.5.1557
949b9d33-8922-4392-a808-0004281523c8Microsoft Office 365 ProPlus - en-usMicrosoft Office 365 ProPlus 20165/6/2019 0:0016.0.10730.2033416.0.8431.2250
949b9d33-8922-4392-a808-0004281523c8Notepad++ (64-bit x64)Notepad++12/12/2018 0:007.5.6null
949b9d33-8922-4392-a808-0004281523c8SnapComms AppSnapComms App 174/1/2019 0:0017.12.145617.12.1456
949b9d33-8922-4392-a808-0004281523c8SteelCentral Aternity AgentAternity Agent 9.25/10/2019 0:009.2.6.419.2.6.41
9dd8b833-fdd2-44b6-8cff-000477014629Microsoft Office 365 ProPlus - en-usMicrosoft Office 365 ProPlus 20165/26/2019 0:0016.0.10730.2033416.0.8431.2250
9dd8b833-fdd2-44b6-8cff-000477014629SteelCentral Aternity AgentAternity Agent 9.25/15/2019 0:009.2.6.419.2.6.41
9dd8b833-fdd2-44b6-8cff-000477014629VMware Horizon ClientVMware Horizon Client 42/5/2019 0:004.7.0.110744.7.0.11074
3707a2c7-a5a4-4e59-83a5-0005a44b344fCb Defense Sensor 64-bitCarbon Black Defense Sensor 311/1/2018 0:003.2.1.513.2.1.51
3707a2c7-a5a4-4e59-83a5-0005a44b344fCb Defense Sensor 64-bitCarbon Black Defense Sensor 311/1/2018 0:003.2.1.513.2.1.51
3707a2c7-a5a4-4e59-83a5-0005a44b344fMicrosoft Office 365 ProPlus - en-usMicrosoft Office 365 ProPlus 20165/16/2019 0:0016.0.10730.2033416.0.8431.2250
3707a2c7-a5a4-4e59-83a5-0005a44b344fSteelCentral Aternity AgentAternity Agent 9.25/3/2019 0:009.2.6.419.2.6.41
c996c00f-63ce-4c6d-b0ba-0005f64af7c4Aternity AgentAternity Agent 9.14/20/2018 0:009.1.7.449.1.7.44
c996c00f-63ce-4c6d-b0ba-0005f64af7c4Microsoft Office 365 ProPlus - fr-frMicrosoft Office 365 ProPlus 20163/18/2019 0:0016.0.8431.232916.0.8431.2250
c996c00f-63ce-4c6d-b0ba-0005f64af7c4VMware Horizon ClientVMware Horizon Client 44/24/2018 0:004.5.0.80904.7.0.11074
c996c00f-63ce-4c6d-b0ba-0005f64af7c4Microsoft OneDriveMicrosoft OneDrive 194/17/2019 0:0019.043.0304.000719.033.0218.0011
bca403f8-6055-4e95-9d40-0006b08299c47-Zip 19.00 (x64 edition)7-Zip4/24/2019 0:0019.00.00.018.06.00.0
bca403f8-6055-4e95-9d40-0006b08299c47-Zip 19.00 (x64 edition)7-Zip4/24/2019 0:0019.00.00.018.06.00.0
bca403f8-6055-4e95-9d40-0006b08299c4Microsoft Office 365 ProPlus - pl-plMicrosoft Office 365 ProPlus 20165/5/2017 0:0016.0.6965.210516.0.8431.2250
bca403f8-6055-4e95-9d40-0006b08299c4Microsoft Visio Professional 2016 - pl-plMicrosoft Visio Professional 20165/5/2017 0:0016.0.6965.210516.0.7167.2040
bca403f8-6055-4e95-9d40-0006b08299c4Microsoft Visio Professional 2016 - pl-plMicrosoft Visio Professional 20165/5/2017 0:0016.0.6965.210516.0.7167.2040
bca403f8-6055-4e95-9d40-0006b08299c4Microsoft OneDriveMicrosoft OneDrive 196/16/2019 0:0019.086.0502.000619.033.0218.0011
a3c60af5-aa37-40fd-8332-0006e63c2215ALM v4ALM 4.54/23/2019 0:004.5.0.94.5.0.9
a3c60af5-aa37-40fd-8332-0006e63c2215SnapComms AppSnapComms App 177/30/2018 0:0017.12.145617.12.1456
a3c60af5-aa37-40fd-8332-0006e63c2215Microsoft OneDriveMicrosoft OneDrive 196/7/2019 0:0019.086.0502.000619.033.0218.0011
a3c5e533-8eb0-41fc-a192-000779929fcdCb Defense Sensor 64-bitCarbon Black Defense Sensor 311/29/2018 0:003.2.1.513.2.1.51
a3c5e533-8eb0-41fc-a192-000779929fcdCb Defense Sensor 64-bitCarbon Black Defense Sensor 311/29/2018 0:003.2.1.513.2.1.51
a3c5e533-8eb0-41fc-a192-000779929fcd7-Zip 19.00 (x64 edition)7-Zip3/22/2019 0:0019.00.00.018.06.00.0
a3c5e533-8eb0-41fc-a192-000779929fcd7-Zip 19.00 (x64 edition)7-Zip3/22/2019 0:0019.00.00.018.06.00.0
a3c5e533-8eb0-41fc-a192-000779929fcdMicrosoft Office 365 ProPlus - fr-frMicrosoft Office 365 ProPlus 201611/30/2018 0:0016.0.9126.231516.0.8431.2250
a3c5e533-8eb0-41fc-a192-000779929fcdSnapComms AppSnapComms App 1712/3/2018 0:0017.12.145617.12.1456
a3c5e533-8eb0-41fc-a192-000779929fcdVMware Horizon ClientVMware Horizon Client 411/29/2018 0:004.8.1.21794.7.0.11074
a3c5e533-8eb0-41fc-a192-000779929fcdMicrosoft OneDriveMicrosoft OneDrive 194/17/2019 0:0019.043.0304.000719.033.0218.0011
48d43e86-835d-4769-b792-00078dacc5f1Google Earth ProGoogle Earth Pro3/19/2019 0:007.3.2.57767.1.5.1557
48d43e86-835d-4769-b792-00078dacc5f1Microsoft Office 365 ProPlus - en-usMicrosoft Office 365 ProPlus 20165/12/2019 0:0016.0.10730.2033416.0.8431.2250
48d43e86-835d-4769-b792-00078dacc5f1Snagit 2018Snagit 20187/24/2018 0:0018.2.118.2.1.1590
48d43e86-835d-4769-b792-00078dacc5f1Microsoft OneDriveMicrosoft OneDrive 196/17/2019 0:0019.086.0502.000619.033.0218.0011
061a0b6c-9ecc-4f18-ac0f-000971bb94adAternity AgentAternity Agent 9.112/4/2017 0:009.1.7.449.1.7.44
061a0b6c-9ecc-4f18-ac0f-000971bb94adCb Defense Sensor 64-bitCarbon Black Defense Sensor 39/12/2018 0:003.2.1.513.2.1.51
061a0b6c-9ecc-4f18-ac0f-000971bb94adCb Defense Sensor 64-bitCarbon Black Defense Sensor 39/12/2018 0:003.2.1.513.2.1.51
061a0b6c-9ecc-4f18-ac0f-000971bb94adMcAfee AgentMcAfee Agent 58/2/2017 0:005.0.4.4705.0.6.220
061a0b6c-9ecc-4f18-ac0f-000971bb94adMicrosoft Office 365 ProPlus - en-usMicrosoft Office 365 ProPlus 20163/26/2019 0:0016.0.10730.2030416.0.8431.2250
061a0b6c-9ecc-4f18-ac0f-000971bb94adSnapComms AppSnapComms App 171/10/2018 0:0017.12.145617.12.1456
949d0c91-2eb7-4345-96d5-000a48f8fa67Cb Defense Sensor 64-bitCarbon Black Defense Sensor 39/12/2018 0:003.2.1.513.2.1.51
949d0c91-2eb7-4345-96d5-000a48f8fa67Cb Defense Sensor 64-bitCarbon Black Defense Sensor 39/12/2018 0:003.2.1.513.2.1.51
8970e2b2-26d8-4566-8bb7-000a8989dd107-Zip 19.00 (x64 edition)7-Zip4/2/2019 0:0019.00.00.018.06.00.0
8970e2b2-26d8-4566-8bb7-000a8989dd107-Zip 19.00 (x64 edition)7-Zip4/2/2019 0:0019.00.00.018.06.00.0
8970e2b2-26d8-4566-8bb7-000a8989dd10VMware Horizon ClientVMware Horizon Client 43/8/2019 0:004.10.0.42724.7.0.11074
8970e2b2-26d8-4566-8bb7-000a8989dd10Microsoft OneDriveMicrosoft OneDrive 196/11/2019 0:0019.086.0502.000619.033.0218.0011
c22e43ed-c62b-4bc1-a1f2-000c957b9e3eCb Defense Sensor 64-bitCarbon Black Defense Sensor 39/14/2018 0:003.2.1.513.2.1.51
c22e43ed-c62b-4bc1-a1f2-000c957b9e3eCb Defense Sensor 64-bitCarbon Black Defense Sensor 39/14/2018 0:003.2.1.513.2.1.51
c22e43ed-c62b-4bc1-a1f2-000c957b9e3eSteelCentral Aternity AgentAternity Agent 9.25/10/2019 0:009.2.6.419.2.6.41
19b65d1a-54ab-46ca-8fba-0003dd6f492fCisco AnyConnect Secure Mobility Client Cisco AnyConnect Secure Mobility Client 45/19/2019 0:004.3.050174.3.05017
19b65d1a-54ab-46ca-8fba-0003dd6f492fCisco JabberCisco Jabber5/19/2019 0:0012.1.1.1986612.5.1.27406
19b65d1a-54ab-46ca-8fba-0003dd6f492fCitrix Workspace 1812Citrix Workspace5/19/2019 0:0018.12.0.12null
19b65d1a-54ab-46ca-8fba-0003dd6f492fCitrix WorkSpace BrowserCitrix Workspace5/19/2019 0:0018.12.0.10null
19b65d1a-54ab-46ca-8fba-0003dd6f492fCitrix Workspace InsideCitrix Workspace5/19/2019 0:0018.12.0.65534null
19b65d1a-54ab-46ca-8fba-0003dd6f492fCitrix Workspace(Aero)Citrix Workspace5/19/2019 0:0018.12.0.12null
19b65d1a-54ab-46ca-8fba-0003dd6f492fCitrix Workspace(SSON)Citrix Workspace5/19/2019 0:0018.12.0.12null
19b65d1a-54ab-46ca-8fba-0003dd6f492fCitrix Workspace(USB)Citrix Workspace5/19/2019 0:0018.12.0.12null
19b65d1a-54ab-46ca-8fba-0003dd6f492fVeritas Enterprise Vault Outlook Add-in (x64) 12.2.1.1485Veritas Enterprise Vault Outlook Add-in 125/19/2019 0:0012.2.558112.2.9718
19b65d1a-54ab-46ca-8fba-0003dd6f492fVeritas Enterprise Vault Outlook Add-in (x64) 12.2.1.1485Veritas Enterprise Vault Outlook Add-in 125/19/2019 0:0012.2.558112.2.9718
19b65d1a-54ab-46ca-8fba-0003dd6f492fJava 8 Update 202Java(TM) 86/10/2019 0:008.0.2020.8null
949b9d33-8922-4392-a808-0004281523c8Citrix WorkSpace BrowserCitrix Workspace12/12/2018 0:0018.9.0.19515null
949b9d33-8922-4392-a808-0004281523c8Citrix Workspace InsideCitrix Workspace12/12/2018 0:0018.9.0.65534null
949b9d33-8922-4392-a808-0004281523c8Citrix Workspace(DV)Citrix Workspace12/12/2018 0:0018.9.0.19526null
949b9d33-8922-4392-a808-0004281523c8Citrix Workspace(USB)Citrix Workspace12/12/2018 0:0018.9.0.19526null
949b9d33-8922-4392-a808-0004281523c8Google ChromeGoogle Chrome5/22/2019 0:0074.0.3729.16973.0.3683.86
949b9d33-8922-4392-a808-0004281523c8Adobe Acrobat DCAdobe Acrobat DC 196/13/2019 0:0019.012.20035null
9dd8b833-fdd2-44b6-8cff-000477014629Cisco AnyConnect Secure Mobility Client Cisco AnyConnect Secure Mobility Client 42/5/2019 0:004.3.050174.3.05017
9dd8b833-fdd2-44b6-8cff-000477014629Google ChromeGoogle Chrome2/5/2019 0:0074.0.3729.16973.0.3683.86
9dd8b833-fdd2-44b6-8cff-000477014629Microsoft TeamsMicrosoft Teams 15/28/2019 0:001.2.00.137651.2.00.8864
9dd8b833-fdd2-44b6-8cff-000477014629Java 8 Update 202Java(TM) 82/23/2019 0:008.0.2020.8null
3707a2c7-a5a4-4e59-83a5-0005a44b344fCisco AnyConnect Secure Mobility Client Cisco AnyConnect Secure Mobility Client 411/19/2018 0:004.5.050304.3.05017
3707a2c7-a5a4-4e59-83a5-0005a44b344fGoogle ChromeGoogle Chrome5/28/2019 0:0074.0.3729.16973.0.3683.86
c996c00f-63ce-4c6d-b0ba-0005f64af7c4Cisco AnyConnect Secure Mobility Client Cisco AnyConnect Secure Mobility Client 44/13/2018 0:004.3.050174.3.05017
c996c00f-63ce-4c6d-b0ba-0005f64af7c4Java 8 Update 202Java(TM) 82/25/2019 0:008.0.2020.8null
c996c00f-63ce-4c6d-b0ba-0005f64af7c4Adobe Acrobat Reader DCAdobe Acrobat Reader DC 194/29/2019 0:0019.010.2009919.010.20098
bca403f8-6055-4e95-9d40-0006b08299c4Cisco AnyConnect Secure Mobility Client Cisco AnyConnect Secure Mobility Client 44/21/2017 0:004.3.050174.3.05017
bca403f8-6055-4e95-9d40-0006b08299c4Cisco JabberCisco Jabber4/16/2019 0:0012.1.1.1986612.5.1.27406
bca403f8-6055-4e95-9d40-0006b08299c4Google ChromeGoogle Chrome5/29/2019 0:0074.0.3729.16973.0.3683.86
bca403f8-6055-4e95-9d40-0006b08299c4Microsoft Office SharePoint Designer MUI (English) 2007Microsoft SharePoint Designer 20076/26/2017 0:0012.0.6612.1000null
bca403f8-6055-4e95-9d40-0006b08299c4Veritas Enterprise Vault Outlook Add-in (x64) 12.1.1.1451Veritas Enterprise Vault Outlook Add-in 128/31/2017 0:0012.1.554712.2.9718
bca403f8-6055-4e95-9d40-0006b08299c4Veritas Enterprise Vault Outlook Add-in (x64) 12.1.1.1451Veritas Enterprise Vault Outlook Add-in 128/31/2017 0:0012.1.554712.2.9718
a3c60af5-aa37-40fd-8332-0006e63c2215Adobe Acrobat Reader DC MUIAdobe Acrobat Reader DC 195/1/2019 0:0019.010.2009919.010.20098
a3c60af5-aa37-40fd-8332-0006e63c2215Dell Display ManagerDell Display Manager4/23/2019 0:00  
a3c60af5-aa37-40fd-8332-0006e63c2215Google ChromeGoogle Chrome5/22/2019 0:0074.0.3729.16973.0.3683.86
a3c60af5-aa37-40fd-8332-0006e63c2215Java 8 Update 202Java(TM) 82/25/2019 0:008.0.2020.8null
a3c60af5-aa37-40fd-8332-0006e63c2215PasscodePasscode 2.0.0 11/10/2017 0:002.0.1.02.0.1.0
a3c60af5-aa37-40fd-8332-0006e63c2215ZoomZoom 44/23/2019 0:004.14.1.34583
a3c5e533-8eb0-41fc-a192-000779929fcdCisco JabberCisco Jabber3/4/2019 0:0012.1.1.1986612.5.1.27406
a3c5e533-8eb0-41fc-a192-000779929fcdTableau Reader 10.3 (10300.17.0728.2252)Tableau Reader 1011/29/2018 0:0010.3.78110.5.314
a3c5e533-8eb0-41fc-a192-000779929fcdTableau Reader 10.3 (10300.17.0728.2252)Tableau Reader 1011/29/2018 0:0010.3.78110.5.314
a3c5e533-8eb0-41fc-a192-000779929fcdVeritas Enterprise Vault Outlook Add-in (x64) 12.2.1.1485Veritas Enterprise Vault Outlook Add-in 1211/29/2018 0:0012.2.558112.2.9718lpbi.PNG
Anonymous
Not applicable

Any revret on the above woudl be helpful. Thanks again

@Anonymous ,

 

I couldn't reproduce your issue. Could you please format your python code?

 

Regards,

Jimmy Tao

Anonymous
Not applicable

import pandas as pd
import numpy as np

dataset= pd.read_csv("abhicomp.csv")

v1 = dataset['Latest Packaged Version'].fillna('').tolist()
v2 = dataset['Version'].fillna('').tolist()

def change_string_to_ascii(v12):
    
    fin_list = []
    for i in v12:
        if(i.isdigit()):
            fin_list.append(i)
        else:
            #print(i)
            fin_list.append(ord(i))
        
    #fin_str = "".join(fin_list)
    return fin_list


def compare_list(list1, list2):
    result_list = []
    for i,j in zip(list1, list2):
        if (i == "" or j == ""):
            if(i == ""):
                result_list.append("Upgraded")
            else:
                result_list.append("Not Upgraded")
            continue 
        
        if(len(i) > len(j)):
            result_list.append("Not Upgraded")
            continue
        elif(len(i)< len(j)):
            result_list.append("Upgraded")
            continue
            
        else:
            
            i_arr = i.split(".")
            j_arr = j.split(".")
        
            i_arr_dl = change_string_to_ascii(i_arr)
            j_arr_dl = change_string_to_ascii(j_arr)
        
            count = 0
            for i_val, j_val in zip(i_arr_dl, j_arr_dl):
                count+=1
                if(i_val > j_val):
                    result_list.append("Not Upgraded")
                    break
                elif(i_val == j_val):
                    #print(count, len(i_arr))
                    if(count == len(i_arr)):
                        #print("added")
                        result_list.append("Upgraded")
                    else:
                        continue
                elif(i_val < j_val):
                    result_list.append("Upgraded")
                    break
    return result_list



version_check_list = compare_list(v1, v2)
dataset['res'] = version_check_list

Here you go with the formatted code. It is pretty similar to what I posted on earlier just with few more added corner cases. Thank you again for the help.

@Anonymous ,

 

Please import the csv to power bi at first. Then implement the python script. The script works well on my side.

Capture.PNG 

Community Support Team _ Jimmy Tao

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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