Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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 for latest year(2022 in this case) but its calculating for all years.I tried instead of latest year i put 2022 and it displayed the sales for 2022.But i check the value of latest year and it returns 2022 so why doesnt it work.
this my latest year measure
Solved! Go to Solution.
@WalletMasster- 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.
@WalletMasster- 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.
Thanks it works, can i ask you another question its about filtering
Hi Wallet Masster,
You can use below DAX
Total Sales = CALCULATE(SUM(Sales([SalesAmount]),FILTER(YEAR(TODAY())-1)
Let me know if this works
This works too thanks
User | Count |
---|---|
53 | |
44 | |
19 | |
15 | |
14 |
User | Count |
---|---|
107 | |
58 | |
29 | |
21 | |
16 |