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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
renaudgaillard
Frequent Visitor

How to transform text formula coming from SQL into working measure ?

Hi all,

 

I'm trying to automatize financials formulas.

They are in Power Bi DAX code and stored into a SQL database server.

 

So, I've created this measure :

AutoFin = CALCULATE(VALUES(tbl_cusformula[cusformula_value]); tbl_cusformula[cusformula_description] = "AutoFin")

 

The result of the CALCULATE function returns my formula :

(CALCULATE(SUM('GLEntryDW'[Amount]); 'GLEntryDW'[GLAccountNo2]="10") + CALCULATE(SUM('GLEntryDW'[Amount]); 'GLEntryDW'[GLAccountNo2]="14") ...........

 

But it doesn't work.

I think Power Bi interpates the result as a text.
If I copy/paste this result into a new measure it's working.

 

Does someone has any idea to make this working ?

 

Thanks a lot.

 

Regards

 

 

3 REPLIES 3
renaudgaillard
Frequent Visitor

Hi all,

 

Does someone has the same objective and has solution ?

 

Thank you !

v-yulgu-msft
Employee
Employee

Hi @renaudgaillard,

 

According to your description, what you want to get is the calculate result of the text "(CALCULATE(SUM('GLEntryDW'[Amount]); 'GLEntryDW'[GLAccountNo2]="10") + CALCULATE(SUM('GLEntryDW'[Amount]); 'GLEntryDW'[GLAccountNo2]="14") " which is returned by the original measure, right?

 

Currently, this requirement cannot be achieved. The returned result by the measure is regarded as a common string rather than a measure which can run the function again.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for your reply Yuliana_Gu, unfortunately that's what I tought Smiley Sad

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.