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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Riggan2023
Frequent Visitor

Dynamic totals counting in calculated column

Hi. I need help vith creating a dinamic total calculations in my calendar table. 

So I have a table called Dataset consisted of  foloving columns: ArchDate, Type, Status. 

Riggan2023_0-1673023952593.png

And of caurse I can use slicers to filter it by Status or Type.

Ive created a Calendar table using DAX 

MyCalendar = CALENDAR(DATE(2020,01,01),TODAY())

 

Then I've added calculated column "Totals" which counts a number of occurances of each date in Dataset[ArchDate] 

 

Totals = 
var total_Calc=CALCULATE(COUNTA('Dataset'[ArchDate]),FILTER('Dataset','Dataset'[ArchDate]=MyCalendar[Date]))
return if(total_Calc=BLANK(),0,total_Calc)

 

And now my calendar looks like thisRiggan2023_1-1673024310053.png

 

But my problem is that I cant use slicers to filter values of Dataset. For example I need to count just First Stage but if I select the value of the Typeslider values of MyCalendar[Totals] remains the same. 

Riggan2023_0-1673024888577.png

 

 

Please advise how to resolve it. Is it possible? This is my sample pbix https://file.io/Hk0hc48YCOfi 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Riggan2023 , Create a measure like

 

Totals =
var total_Calc=CALCULATE(COUNTA('Dataset'[ArchDate]),FILTER('Dataset','Dataset'[ArchDate]=related(MyCalendar[Date]))
return if(total_Calc=BLANK(),0,total_Calc)

 

 

I think this should work too

 

Totals = CALCULATE(COUNTA('Dataset'[ArchDate]))+0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I've tried both your suggestions:

Totals = 
var total_Calc=CALCULATE(COUNTA('Dataset'[ArchDate]),FILTER('Dataset','Dataset'[ArchDate]=related(MyCalendar[Date])))
return if(total_Calc=BLANK(),0,total_Calc)

This shows me that MyCalendar[Date] does not exists.

The second code counts same totals for each row

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors