Forum Discussion

jteixeira's avatar
jteixeira
Regular Visitor
3 years ago
Solved

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?
 
 
  • 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.

     

    Regards

    Hugh

1 Reply

  • 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.

     

    Regards

    Hugh