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

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.

Reply
Analitika
Post Prodigy
Post Prodigy

Average sum using Date slicer in Power BI

Hello,

 

I would like to ask how to calculate average sum using Date slicer, when selecting year, month etc. Here how looks date slicer.

Analitika_0-1655358214437.png

What measure to use, I used measure like this:

divide(
[sum],[selected_month]).
 
selected_month=
Pasirinkta menesiu =

SWITCH(
TRUE(),
ISFILTERED(_Date[Date].[Month]), IF(QUOTIENT(COUNT(_Date[Date].[Month]),30)=0,1,QUOTIENT(COUNT(_Date[Date].[Month]),30)),
IF(QUOTIENT(COUNT(_Date[Date].[Month]),30)=0,1,QUOTIENT(COUNT(_Date[Date].[Month]),30))
)
 
But it works when data is per 12 month, if appears several months, it gives wrong value.

 

1 REPLY 1
Anonymous
Not applicable

Hi @Analitika,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

In addition, you can also try to use the following formula if hleps:

selected_month =
MIN ( COUNTROWS ( SUMMARIZE ( ALLSELECTED ( Table ), [Year], [Month] ) ), 1 )

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.