Reply
jteixeira
Regular Visitor
Partially syndicated - Outbound

DAX Calculation Question

Hi Guys! 
I am building a measure, actually a very basic and simple measure but the data is not showing the expected results when for example I compare it with the data in Excel!

 

I am using the finantials data sample for Power BI with this simple measure:
Sales Above Average =

VAR AverageSales = [Average Sales]
VAR FiltredTable =
    FILTER(
        financials;
        financials[ Sales] > AverageSales
    )
VAR CountSales = COUNTROWS(FiltredTable)
RETURN
    CountSales
 
So I need to get the number of records above Average! The Results are not the same! But I believe the measure is well done. 
If i get a new Filtred Table in Power BI it works fine. So must be the evaluation context of the variables! 
Any help?
 
 
pbi1.pngpbi2.pngPbi3.png
1 ACCEPTED SOLUTION
HughLa
Resolver IV
Resolver IV

Syndicated - Outbound

Hi @jteixeira 

 

Your measure is correct. I just had a look at the data myself and the results match between Power BI and the Excel file.

 

What value did you filter out on the Sales column in your excel file?

 

For October 2013, the average sales was 132794,44 so if you set the filter to greater that that it returns 16 rows in the Excel file as well.

HughLa_0-1681300959286.png

 

Regards

Hugh

View solution in original post

1 REPLY 1
HughLa
Resolver IV
Resolver IV

Syndicated - Outbound

Hi @jteixeira 

 

Your measure is correct. I just had a look at the data myself and the results match between Power BI and the Excel file.

 

What value did you filter out on the Sales column in your excel file?

 

For October 2013, the average sales was 132794,44 so if you set the filter to greater that that it returns 16 rows in the Excel file as well.

HughLa_0-1681300959286.png

 

Regards

Hugh

avatar user

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)