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
freakinaditya
Helper II
Helper II

How to convert Tableau measures to Power bi Dax?

Hi,

 

I am in the process of converting a load of Tableau dashboards into Power BI but cannot figure out how to translate this particular measure and was hoping someone could point me in the right direction:

 

{ EXCLUDE [DATE] : AVG ( { INCLUDE [CATEGORY],[DATE] : AVG ( IF {MAX([DATE])} = [DATE]  THEN [TOTAL_SALES] END) }) }

Here [TOTAL_SALES] is a measure.

 

Thanks in advance!!

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @freakinaditya ,

 

Try:

Average total_sales = CALCULATE(AVERAGEX( 
    SUMMARIZE('table', 'table'[CATEGORY], 'table'[DATE], "TOTAL_SALES", [TOTAL_SALES])), 
    [TOTAL_SALES] 
),FILTER(ALLSELECTED('table'[DATE]),'table'[DATE]=[LARGEST DATE]))

If the problem persists,could you share the sample data and the result you expected?

How-to-provide-sample-data-in-the-Power-BI-Forum 

 

Best Regards,
Liang
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

@freakinaditya , difficult to tell . Try like

averageX(values(Table[CATEGORY]),calculate([TOTAL_SALES], filter(Table,Table[Date] = max(Table[Date])) allexcept(Table,Table[CATEGORY],Table[DATE])))

 

If not

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

 

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.