Quantcast
Channel: Developer topics
Viewing all articles
Browse latest Browse all 17878

Does Power BI the right solution for my problem?

$
0
0

Hi ,

 

I am analyzing a database of almost a million rows (Excel file), and I want to apply a function "ExtrationPercentage" developed by VBA. This function extracts the percentages of a text cell. So I follow the following procedure: I copy the formula, then I paste it on a range of cell.

 

The approach works well on few hundreds rows, but when I apply it to almost a million rows, (i) the execution of the function becomes heavy (almost 40 minutes of treatment); and (ii) the result becomes unreliable (no results, rather display of "#VALUE!" in all the cells containing the function.

 

For test purposes, I send a file that shows some rows of my database with the VBA code of function "ExtrationPercentage". This will give you a clear idea about my problem. Here is the link of the Excel file:

 

https://www.cjoint.com/c/HFBtZKBuGFP

 

So, my question is:

 

Please, do you have an approach, a procedure, a VBA code, or a Power BI request that could make it easier for me to apply my function to my entire database? Or to resolve my percentage extraction problem for all my database? 

 

I just learned today about the existence of Power BI by a member of Microsoft community, and I don't know if it could help me solve my problem. What is your opinion/suggestion?

 

Thank you very much for your involvement and for your support.

 

Jad

 

Reminder: VBA code used for the function "ExtrationPercentage"(Developed by Arnaud "Hecatonchire", a member of the microsoft community )

 

====================================================

Function ExtrationPourcentage(Chaine As String, k As Byte) As Single
    Dim reg As Object
    Dim Resultats As Object
    Dim Resultat As String
    
    Set reg = CreateObject("vbscript.regexp")
    reg.Global = True
    
    reg.Pattern = "\d+\.?\d*\%"
    Set Resultats = reg.Execute(Chaine)
    If Resultats.Count <> 0 Then
        Resultat = Replace(Replace(Resultats.Item(k - 1), "(", ""), "%", "")
    End If
    ExtrationPourcentage = (Replace(Resultat, ".", ",") / 100)
End Function

====================================================


Viewing all articles
Browse latest Browse all 17878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>