Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Issue with measures

Hi i am new to Power BI  Total Sales (Latest Year) = CALCULATE( SUM(Sale[SalesAmount]), FILTER('Sale', 'Sale'[Date].[Year] = [Latest Year]) ) i have this measure which is suppose to calculate sales ...
  • Manoj_Nair's avatar
    3 years ago

    Anonymous- Please check this out, let me know if this works. If this fix your problem, please tick this a solution and a thumps up.

     

    Total Sales (Latest Year) = 
    VAR CurrentYear = MAX('Sale'[Date].[Year])
    RETURN
    CALCULATE(
        SUM('Sale'[SalesAmount]), 
        FILTER('Sale', YEAR('Sale'[Date]) = CurrentYear)
    )

     

    I've hypothetically established this DAX measure, but without much clarity regarding your datasets. If this doesn't serve your needs, I recommend you share a sample dataset. This will give me a more comprehensive understanding of your data structure, enabling me to devise a more suitable solution.