Forum Discussion

gkakun's avatar
gkakun
Icon for Helper III rankHelper III
8 years ago

Group By measure

Hi all,

 

I have a problem with group by measure. 

 

I have a table called FOI- with Transaction ID (Unique), part number, Supplier Name, location of the part, failure reason, failure timestamp, and more descrptive fields of the part. 

Eventually i need to get a table with supplier name and the number of parts which failed more than twice. 

For example - Supplier XXX-->6 (for this vendor, 6 units failed more than twice) 

Im thinkign to use the group bt with few iterations, but cant find the right way to do that. 

 

Any idea? 

12 Replies

  • iamprajot's avatar
    iamprajot
    Icon for Responsive Resident rankResponsive Resident
    Create a new Table from Modeling,
    Table =
    SUMMARIZE(FOI,FOI[Supplier_Name],"Supplier Name",IF( CALCULATE(COUNT(FOI[Return]),FILTER(FOI,NOT(ISBLANK(FOI[Return]))))>=2, CALCULATE(COUNT(FOI[Return]),FILTER(FOI,NOT(ISBLANK(FOI[Return])))),BLANK()))
    • gkakun's avatar
      gkakun
      Icon for Helper III rankHelper III

      Thanks for your feedback!

       

      when you say FOI[Return] you mean the unioque field in the table? 

      it should count the part number right? 

    • gkakun's avatar
      gkakun
      Icon for Helper III rankHelper III

      I have tried this one and got this error (with FOI[IPN] instead if FOI[Return])

       

      Function SUMMARIZE expects a column name as argument number 3.

      • iamprajot's avatar
        iamprajot
        Icon for Responsive Resident rankResponsive Resident
        Return is failure reason of your data,
        please change the column name according to your data.
        also tell me how you identify if a transaction is failed, as basis of that the dax will work.