Forum Discussion

Aucesar's avatar
Aucesar
Icon for Helper III rankHelper III
3 years ago
Solved

Scalar Value, dealing with text convert DAX Table to Measure

Hi Community,

 

I could create a table with this:

 

NewTable = SUMMARIZE(tableA, TableA[Shift1], "NewColunm", DISTINCTCOUNT(TableA[ProductionBtach]))

 

Everithing good, but when I tried to use as Measure, I got "multiple columns cannot be converted to a scalar value". So my question is how to transform DAX above to be used as measure? both colunms are text.

 

  • Aucesar's avatar
    Aucesar
    3 years ago

    Hi v-zhangti I forgot to close this topic I figured out using another method, in my calculation I did the "removefilters" and it worked as expected. Thanks for your time, this the expected result.

     

     

     

     

9 Replies

  • Like you said, you're creating a table with that DAX function you've written. 

    If you need it to display as a measure in a table, you need to tell powerBI how to summarize the table to return only 1 value. Without more specifics, it's hard to tell you how to summarize it, but you can use functions such as MAX, COUNT, etc. 

  • Hi vicky_ sorry, didn´t put any date, basically as below:

     Shift1Shift2Desire Result
    ProductionBatchWorkerWorker2EmployeeProductionBatch-Worked
    A1LoisReggieLois2
    A1LoisReggieReggie3
    A1ReggieLoisDannie2
    A1DannieLois  
    B1LoisReggie  
    B1ReggieLois  
    B1ReggieLois  
    C1ReggieDannie A1
    C1DannieReggie  
    C1ReggieDannie  
    C1DannieReggie  
    A1LoisReggie  
    A1LoisReggie  
    A1ReggieLois  
    A1DannieLois  
    B1LoisReggie  
    B1ReggieLois  
    B1ReggieLois  
    C1ReggieDannie  
    C1DannieReggie  
    C1ReggieDannie  
    C1DannieReggie  
  • Semaj06's avatar
    Semaj06
    Regular Visitor

    Hi

     

    You cannot use it as a measure, you are returning 2 columns and with a measure you have to return only 1 value.

    If you want to claculate, just do a measure with the countrows part and just publist the shift colum on the display and your new measure.