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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
vswar
Frequent Visitor

Having difficulty converting Tableau measure to PowerBI Dax.

Hi,

I am in the process of converting few Tableau dashboards into Power BI but having difficulty figuring out this formula.  Can someone point me to right direction. 
 
Bounce Rate Formula : 
SUM({ FIXED [Matmovisit ID] : 
    SUM(
              IF { INCLUDE [Matmovisit ID] : SUM([interactions]) } = 1
                    THEN 1
              ELSE 0
              END
           )}
    ) / COUNT([Matmovisit ID])
 
Thanks in advance!
 
1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @vswar ,

 

To convert your Tableau Bounce Rate formula into Power BI, you can use a DAX approach to replicate the functionality of Tableau's FIXED and INCLUDE functions. Here’s how to structure the formula:

 

To replicate { INCLUDE [Matmovisit ID] : SUM([interactions]) } = 1, you’ll need to calculate interactions per Matmovisit ID and flag those with only one interaction.

 

InteractionsPerVisit = 
    CALCULATE(
        SUM('Table'[Interactions]),
        ALLEXCEPT('Table', 'Table'[Matmovisit ID])
    )
BounceFlag = 
    IF([InteractionsPerVisit] = 1, 1, 0)

 

 

Then, sum up the visits with only one interaction across all Matmovisit ID values.

 

TotalBounces = 
    CALCULATE(
        SUMX(
            VALUES('Table'[Matmovisit ID]),
            IF([InteractionsPerVisit] = 1, 1, 0)
        )
    )

 

Now that you have the count of bounces, you can divide by the total number of visits to get the bounce rate.

 

BounceRate = 
    DIVIDE(
        [TotalBounces],
        COUNT('Table'[Matmovisit ID]),
        0
    )

 

In summary:

  • InteractionsPerVisit calculates the total interactions per Matmovisit ID.
  • BounceFlag flags a visit as a bounce if interactions equal 1.
  • TotalBounces calculates the total bounces across all visits.
  • BounceRate divides total bounces by the total number of visits to get the bounce rate.

This should give you a similar outcome to your Tableau formula.

 

Best regards,

View solution in original post

3 REPLIES 3
DataNinja777
Super User
Super User

Hi @vswar ,

 

To convert your Tableau Bounce Rate formula into Power BI, you can use a DAX approach to replicate the functionality of Tableau's FIXED and INCLUDE functions. Here’s how to structure the formula:

 

To replicate { INCLUDE [Matmovisit ID] : SUM([interactions]) } = 1, you’ll need to calculate interactions per Matmovisit ID and flag those with only one interaction.

 

InteractionsPerVisit = 
    CALCULATE(
        SUM('Table'[Interactions]),
        ALLEXCEPT('Table', 'Table'[Matmovisit ID])
    )
BounceFlag = 
    IF([InteractionsPerVisit] = 1, 1, 0)

 

 

Then, sum up the visits with only one interaction across all Matmovisit ID values.

 

TotalBounces = 
    CALCULATE(
        SUMX(
            VALUES('Table'[Matmovisit ID]),
            IF([InteractionsPerVisit] = 1, 1, 0)
        )
    )

 

Now that you have the count of bounces, you can divide by the total number of visits to get the bounce rate.

 

BounceRate = 
    DIVIDE(
        [TotalBounces],
        COUNT('Table'[Matmovisit ID]),
        0
    )

 

In summary:

  • InteractionsPerVisit calculates the total interactions per Matmovisit ID.
  • BounceFlag flags a visit as a bounce if interactions equal 1.
  • TotalBounces calculates the total bounces across all visits.
  • BounceRate divides total bounces by the total number of visits to get the bounce rate.

This should give you a similar outcome to your Tableau formula.

 

Best regards,

Thanks you so much for this. Your DAX functions are calculating the data precisely. 

Ritaf1983
Super User
Super User

Hi @vswar 

Please provide a workable sample data and your expected result from that. It is hard to figure out what you want to achieve from the description alone.  

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.