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
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
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.

Top Solution Authors