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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
jteixeira
Regular Visitor

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

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

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

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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