Forum Discussion

fceusters's avatar
fceusters
Regular Visitor
5 years ago

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

  • 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

    • fceusters's avatar
      fceusters
      Regular Visitor

      Hi Phil,

      Tanks for the quick respons,

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

      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

      • v-yingjl's avatar
        v-yingjl
        Community Support

        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