Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi guys,
I have values for 2019,2020,2021 and 2022 years. I want to calculate monthly and cumulative average for per year but the years are seperately each other. Is there a Dax formula for this? In a one table, I wanna calculate just 2019 or 2020 or 2021 or 2022. For cumulative, I have tried following formula but when i filter with year, It doesn't calculate just the filtered year, It only shows values of filtered yar.
Thank you.
Solved! Go to Solution.
Hi guys, I have just changed ALL() function to ALLSELECTED() function, and it's worked.
Kümülatif Setup Hariç Ortalama Üretim Adeti = CALCULATE(AVERAGE('2022 H4'[Üretim Adeti]),FILTER(ALLSELECTED('2022 H4'),'2022 H4'[TARİH] <= MAX('2022 H4'[TARİH])),'2022 H4'[SETUP] <> "S")
Hi guys, I have just changed ALL() function to ALLSELECTED() function, and it's worked.
Kümülatif Setup Hariç Ortalama Üretim Adeti = CALCULATE(AVERAGE('2022 H4'[Üretim Adeti]),FILTER(ALLSELECTED('2022 H4'),'2022 H4'[TARİH] <= MAX('2022 H4'[TARİH])),'2022 H4'[SETUP] <> "S")
You can use the DatesBetween function to get the a specific year, for example this would return only 2019 (copied from your formula)
Kümülatif Setup Hariç Ortalama Üretim Adeti = CALCULATE(AVERAGE('2022 H4'[Üretim Adeti]),DatesBetween(Table[Date],"1/1/2019","12/31/2019"))
I have tried as your suggestion. But in graph, it shows values month by month. I wanna show values cumulative month by month with another line. What kind of DAX formula would I use?