Forum Discussion

tyjames05's avatar
tyjames05
Helper I
2 years ago
Solved

Power Bi Desktop - Creating measure from multiple data inputs

Another question helpful people!

I'm trying to add these 3 data points to get a total.. and the DAX formula that I'm using is coming out all messed up. 

 

TA = SUMX('RawData'RawDATA[Total Assemblies for Above Cell During Selected Shift]+RawDATA[Total CUT TO LENGTH pieces for Above Cell During Selected Shift]+RawDATA[Total PARFLEX pieces for Above Cell During Selected Shift]
Thats what I'm using. But if you look at the second picture once I select the measure to add to the table it doesn't compute correctly. I think the reason might have to do with somedays there are multiple entries for the same cell. Cell 2 might have multiple entries because part of the day they worked on assemblies and another part of the day they worked on CTLs.
 

 

 

  • I figured out the issue to my problem. 

     

    Total Parts Good = [Total Assemblies for Above Cell During Selected Shift]+[Total CUT TO LENGTH pieces for Above Cell During Selected Shift]+[Total PARFLEX pieces for Above Cell During Selected Shift] worked for me but
     
    TAS = SUMX('RawData', RawDATA[Total Assemblies for Above Cell During Selected Shift]+RawDATA[Total CUT TO LENGTH pieces for Above Cell During Selected Shift]+RawDATA[Total PARFLEX pieces for Above Cell During Selected Shift]) --- would come out all wacky. I think it was because I created the measure in "RawDATA" but I was pulling everything else from "Table1"
     

     

4 Replies

  • I figured out the issue to my problem. 

     

    Total Parts Good = [Total Assemblies for Above Cell During Selected Shift]+[Total CUT TO LENGTH pieces for Above Cell During Selected Shift]+[Total PARFLEX pieces for Above Cell During Selected Shift] worked for me but
     
    TAS = SUMX('RawData', RawDATA[Total Assemblies for Above Cell During Selected Shift]+RawDATA[Total CUT TO LENGTH pieces for Above Cell During Selected Shift]+RawDATA[Total PARFLEX pieces for Above Cell During Selected Shift]) --- would come out all wacky. I think it was because I created the measure in "RawDATA" but I was pulling everything else from "Table1"
     

     

  • tyjames05 , Create this as measure

     

    TA = SUMX('RawData', RawDATA[Total Assemblies for Above Cell During Selected Shift]+RawDATA[Total CUT TO LENGTH pieces for Above Cell During Selected Shift]+RawDATA[Total PARFLEX pieces for Above Cell During Selected Shift])

     

    if you need new column, you need to create one like

     

    TA = ,RawDATA[Total Assemblies for Above Cell During Selected Shift]+RawDATA[Total CUT TO LENGTH pieces for Above Cell During Selected Shift]+RawDATA[Total PARFLEX pieces for Above Cell During Selected Shift]

    • tyjames05's avatar
      tyjames05
      Helper I

      Hello,

       

      Yeah I was trying to create a measure and then use that measure in the table, not create a new column, sorry.

       

      Your formula looks exactly like the one I tried. When I create the measure and put it in the table it looks like this.

       

       

      I think it's adding up ALL of them and coming up with one massive number. I want it to be adding it up with specific totals for each day. What I'm trying to accomplish is we have 3 entries. Total Assemblies, Total CTL, and Total parflex. They are all different types of finished product. I want to create a measure where all 3 of them are added up as one on a day by day basis.

       

       

  • Once I deleted the old measure and created it in "Table1" everything came out correct.