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
fceusters
Regular Visitor

Converting string expression to formula

Hello,

I want do something with PowerPivot/DAX for designing a model that can calculate a composition of existing measuring points.

I explain my setup a little

  • One table consists of all meters: a column with the unique meter_id, and information about the hierarchical structure where the meter is located
  • One table with all monitored data of the meters: there is also a column with meter_id; a column with the month or quarter; and a column with the actual measured value
  • One table with different "compositions": in this table there is a column where the composition is expressed as a string with reference to different meter_id's.


The meter_id's are like m0001, m0002, ....
The expression of the composition in the third table can be in different forms like:
"m0001 + m0002", or "m0001/(m0001+m0002)*m0003", or "m0004 + m0005 - m0006", ...

Does anyone has suggestion on how to handle this case?
Can I make a DAX measure where this column with the "expression of composition" is converted to a formula that gets its data from the all monitored data table?

Thanks,

3 REPLIES 3
PhilipTreacy
Super User
Super User

Hi @fceusters 

Can you please share some actual data.

Qs: If your expresson is m0001 + m0002, how do you know which value for m0001 and m0002 to use?  Does each meter ID appear only once in the meter_id column?

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi Phil,

Tanks for the quick respons,

These meter_ID's are connected to to the table with all monitored data ("SQL")

fceusters_0-1616567306844.png

A sample file with randomized data, and only an example meters structure you can find in:

https://we.tl/t-tpTNu0OfPT

Let me know if I can explain more

Regards,

Frank

Hi @fceusters ,

Seems that not certain what is your expected output based on your description.

Could you please consider combining it with your sample data or some screenshots about your expected output in the table for further discussion so that members in the community could help you better.

 

Best Regards,
Community Support Team _ Yingjie Li

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.