Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tanako123
New Member

From Tableau to PowerBI DAX

Hello 

 

I am currenctly trying to get diffrent reports from Tableau to DAX. I am really a beginner at DAX but can someone exaplain what the formula below in Tabluea does and help me convert it to PowerBI DAX. I think fixed does something with the level of detail??

 

 

IF { FIXED [FormulierId]:MAX(CONTAINS([Type melding (group)],'Reguliere melding'))} THEN { FIXED [FormulierId]:MAX('Reguliere melding')}
ELSEIF { FIXED [FormulierId]:MAX(CONTAINS([Type melding (group)],'Politiemelding'))} THEN { FIXED [FormulierId]:MAX('Politiemelding')}
END

 

many thanks!!

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @tanako123

 

Your Tableau formula is the equivalent of a calculated column that says:

  1. For each row, examine all rows with [FormulierId] equal to the value in the current row
  2. If any of those rows has [Type melding (group)] with substring 'Reguliere melding' then return 'Reguliere melding'
  3. Else if any of those rows has [Type melding (group)] with substring 'Politiemelding' then return 'Politiemelding'
  4. Else return Null

 

The DAX equivalent would have to be a calculated column with code like this (I'm calling the table Data😞

 

Calculated Column =
IF (
    NOT (
        ISEMPTY (
            CALCULATETABLE (
                VALUES ( Data[Type melding (group)] ),
                ALLEXCEPT ( Data, Data[FormulierId] ),
                NOT ( ISERROR ( FIND ( "Reguliere melding", Data[Type melding (group)] ) ) )
            )
        )
    ),
    "Reguliere melding",
    IF (
        NOT (
            ISEMPTY (
                CALCULATETABLE (
                    VALUES ( Data[Type melding (group)] ),
                    ALLEXCEPT ( Data, Data[FormulierId] ),
                    NOT ( ISERROR ( FIND ( "Politiemelding", Data[Type melding (group)] ) ) )
                )
            )
        ),
        "Politiemelding"
    )
)

 

By the way, the Tableau formula is written a little strangely, since

 

{ FIXED [FormulierId]:MAX('Reguliere melding')}

could be replaced with

'Reguliere melding'

 but this could be because it started off as something more complex.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

3 REPLIES 3
OwenAuger
Super User
Super User

Hi @tanako123

 

Your Tableau formula is the equivalent of a calculated column that says:

  1. For each row, examine all rows with [FormulierId] equal to the value in the current row
  2. If any of those rows has [Type melding (group)] with substring 'Reguliere melding' then return 'Reguliere melding'
  3. Else if any of those rows has [Type melding (group)] with substring 'Politiemelding' then return 'Politiemelding'
  4. Else return Null

 

The DAX equivalent would have to be a calculated column with code like this (I'm calling the table Data😞

 

Calculated Column =
IF (
    NOT (
        ISEMPTY (
            CALCULATETABLE (
                VALUES ( Data[Type melding (group)] ),
                ALLEXCEPT ( Data, Data[FormulierId] ),
                NOT ( ISERROR ( FIND ( "Reguliere melding", Data[Type melding (group)] ) ) )
            )
        )
    ),
    "Reguliere melding",
    IF (
        NOT (
            ISEMPTY (
                CALCULATETABLE (
                    VALUES ( Data[Type melding (group)] ),
                    ALLEXCEPT ( Data, Data[FormulierId] ),
                    NOT ( ISERROR ( FIND ( "Politiemelding", Data[Type melding (group)] ) ) )
                )
            )
        ),
        "Politiemelding"
    )
)

 

By the way, the Tableau formula is written a little strangely, since

 

{ FIXED [FormulierId]:MAX('Reguliere melding')}

could be replaced with

'Reguliere melding'

 but this could be because it started off as something more complex.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn
v-xjiin-msft
Solution Sage
Solution Sage

Hi @tanako123,

 

Honestly, I haven't used Tableau before. So I'm not familiar with the formula in Tabluea or even convert it to DAX.

 

Thereby, could you please make a explaination about the logic of this formula and share us some sample data and the expected result? We can create a new DAX formula based on these information for you. Smiley Happy

 

Thanks,
Xi Jin.

tanako123
New Member

I have to move reports from Tableau to PowerBI, i came along this formula but what exactly did he do? 

can someone please help me convert this to PowerBI DAX

 

 

IF { FIXED [FormulierId]:MAX(CONTAINS([Type melding (group)],'Reguliere melding'))} THEN { FIXED [FormulierId]:MAX('Reguliere melding')}
ELSEIF { FIXED [FormulierId]:MAX(CONTAINS([Type melding (group)],'Politiemelding'))} THEN { FIXED [FormulierId]:MAX('Politiemelding')}
END

 

Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.