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
HiAlmEric
Frequent Visitor

Convert Tableau LOD expression to PowerBI DAX

Hello all,

I'd like to know how to convert this Tableau LOD expression into Power BI DAX. Could you help me, pls?

 

AVG(
{ EXCLUDE [Date],[Segment],[Store Name]:
SUM(
IF [Date] >= DATEADD('month',-7,[ReferenceMonth]) AND
[Date] <= DATEADD('month',-2,[ReferenceMonth])
THEN [Sales_Value] END) / 6 } )

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @HiAlmEric 

Please try the following measure

Measure =
  AVERAGEX(
            SUMMARIZE ( 'Table', 'Table'[Sales_Value] ),
            CALCULATE (
                SUMX (
                     'Table',
                  IF ( [Date] >= DATEADD('Table'[ReferenceMonth],-7,MONTH) && [Date] <= DATEADD('Table'[ReferenceMonth],-2,MONTH),'Table'[Sales_Value]/6              
                    )
                ),
               ALLSELECTED('Table'[Date],'Table'[Segment],'Table'[Store Name])
            )
        )

Best Regards

Community Support Team _ Ailsa Tao

 

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

View solution in original post

2 REPLIES 2
v-yetao1-msft
Community Support
Community Support

Hi @HiAlmEric 

Please try the following measure

Measure =
  AVERAGEX(
            SUMMARIZE ( 'Table', 'Table'[Sales_Value] ),
            CALCULATE (
                SUMX (
                     'Table',
                  IF ( [Date] >= DATEADD('Table'[ReferenceMonth],-7,MONTH) && [Date] <= DATEADD('Table'[ReferenceMonth],-2,MONTH),'Table'[Sales_Value]/6              
                    )
                ),
               ALLSELECTED('Table'[Date],'Table'[Segment],'Table'[Store Name])
            )
        )

Best Regards

Community Support Team _ Ailsa Tao

 

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

amitchandak
Super User
Super User

@HiAlmEric , I created a video, how to do Tableau exclude in power bi, see if this can help

 

LOD exclude (Level of Details): https://youtu.be/wJEjG3O3vrk

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.