Forum Discussion

ncbshiva's avatar
ncbshiva
Advocate V
7 years ago
Solved

From Tableau Fixed function to Power BI DaX

Hi ,

 

I am trying to move my reports from Tableau to Power BI and i have some below LOD function which should be written in DAX.

Can any one please help to convert Tableau LOD to Power BI DAX ?

 

{FIXED
[Dstr Name],[Product description],YEAR([Day Date]), MONTH([Day Date])
:
COUNTD(
IF
[Fulls (Crates or Hl)]>0
THEN
[Product description]
END
)

}

  • How about this:

    -> Add 2 new column to the table:

    Year = YEAR('Table'[day_date])
    Month = MONTH('Table'[day_date])

    -> Create a measure as below:

    Measure =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Product Description] ),
        'Table'[Full(Crates & HL)] > 0,
        ALL ( 'Table'[day_date] ),
        SUMMARIZE (
            'Table',
            'Table'[Dstr Name],
            'Table'[Product description],
            'Table'[Year],
            'Table'[Month]
        )
    )

6 Replies

    • ncbshiva's avatar
      ncbshiva
      Advocate V
      Dstr NameProduct Descriptionday_dateFull(Crates & HL)
      ACola14-9-201728989
      APepsi21-8-2018765
      BFanta1-4-2018631
      Amstel5-12-20177633

       

       

      Hi This is just the sample data , 

  • Hello,

     

    Can anyone help me to convert from Tableau LOD to DAX .

     

    FIXED
    [Dstr Name],[Product description],YEAR([Day Date]), MONTH([Day Date])
    :
    COUNTD(
    IF
    [Fulls (Crates or Hl)]>0
    THEN
    [Product description]
    END
    )

    • AkhilAshok's avatar
      AkhilAshok
      Solution Sage

      How about this:

      -> Add 2 new column to the table:

      Year = YEAR('Table'[day_date])
      Month = MONTH('Table'[day_date])

      -> Create a measure as below:

      Measure =
      CALCULATE (
          DISTINCTCOUNT ( 'Table'[Product Description] ),
          'Table'[Full(Crates & HL)] > 0,
          ALL ( 'Table'[day_date] ),
          SUMMARIZE (
              'Table',
              'Table'[Dstr Name],
              'Table'[Product description],
              'Table'[Year],
              'Table'[Month]
          )
      )