Forum Discussion

drrai66's avatar
drrai66
Resolver I
7 years ago
Solved

Formula Conversion

HI People,

How can I convert This Tableau Formula to Power BI?

 

{FIXED [ID:MAX(IF [Item]="A THEN [Item]END)}

 

This would find if Item="A" for ID 1, then It would write A across all Rows for 1.

 

IDItemResult
1AA
1BA
1CA

 

Thanks

Deepak

  • drrai66's avatar
    drrai66
    7 years ago

    Hi Daniel,

    Your logic will definitely work in the case "A" is minimum, which is actually Minimum in the example  but actually my Data set is something like this

     

    Suppose  the dataset Looks like This:

     

    IDItem
    1Soap
    1Pen
    1Pencil
    2Soap
    2Rubber
    2Paper

     

     


    In Tableau, I would Simply write this  

     

    {FIXED ID:MAX(IF Item="Soap" Then Item end)}

     

    to get This:

     

    IDItemResult
    1SoapSoap
    1PenSoap
    1PencilSoap
    2SoapSoap
    2RubberSoap
    2PaperSoap

     

    I am looking for Similar Logic in Power BI.

     

    Thanks a lot

    Deepak

     

     

  • Hi drrai66,

    Based on my test, you could try this formula:

    Measure = CALCULATE(MAX(Table1[Item]),FILTER(ALL('Table1'),'Table1'[Item]="M"))

    Result:

     

    Regards,

    Daniel He

5 Replies

  • v-danhe-msft's avatar
    v-danhe-msft
    Microsoft Employee

    Hi drrai66,

    Based on my test, you could refer to below formula:

    Measure = CALCULATE(MIN('Table1'[Item]),FILTER(ALLSELECTED('Table1'),'Table1'[ID]=1))

    Result:

    Regards,

    Daniel He

    • drrai66's avatar
      drrai66
      Resolver I

      Hi Daniel,

      Your logic will definitely work in the case "A" is minimum, which is actually Minimum in the example  but actually my Data set is something like this

       

      Suppose  the dataset Looks like This:

       

      IDItem
      1Soap
      1Pen
      1Pencil
      2Soap
      2Rubber
      2Paper

       

       


      In Tableau, I would Simply write this  

       

      {FIXED ID:MAX(IF Item="Soap" Then Item end)}

       

      to get This:

       

      IDItemResult
      1SoapSoap
      1PenSoap
      1PencilSoap
      2SoapSoap
      2RubberSoap
      2PaperSoap

       

      I am looking for Similar Logic in Power BI.

       

      Thanks a lot

      Deepak

       

       

      • v-danhe-msft's avatar
        v-danhe-msft
        Microsoft Employee

        Hi drrai66,

        Based on my test, you could try this formula:

        Measure = CALCULATE(MAX(Table1[Item]),FILTER(ALL('Table1'),'Table1'[Item]="M"))

        Result:

         

        Regards,

        Daniel He