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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Enan
Helper I
Helper I

Count for current month

Hi,

i want to make a measure to count below dates from dim table:

1. Today's date count

2. Current month date count

basically counting dates from my fact table gives me number of my staff not available for work.

 

i have seperate table for calandar as well which is linked to fact table.

 

i have tried to create below measure but it does not give correct value.

 

Today_Count= Calculate(Distinctcount(Fact_NOAV_data[Date]), Fact_NOAV_data=Today())

 

Current Month Count = Calculate(Count(Fact_NOAV_data[Date]),Month(Fact_NOAV_data[Date]=Month(Today()))

 

thank your help.

2 ACCEPTED SOLUTIONS
FreemanZ
Super User
Super User

hi @Enan 

try like:

Today_Count= Calculate(COUNTROWS(Fact_NOAV_data), Fact_NOAV_data[Date]=Today())
 
Current Month Count = Calculate(COUNTROWS(Fact_NOAV_data),Month(Fact_NOAV_data[Date]=Month(Today()))

View solution in original post

@Enan , for current month use

 

Current Month Count = Calculate(Count(Fact_NOAV_data[Date])filter( Fact_NOAV_data ,eomonth(Fact_NOAV_data[Date],0)=eoMonth(Today(),0) ))

 

refer

https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

6 REPLIES 6
Enan
Helper I
Helper I

Thanks bro for helping.

todays_count is working fine with countrows.

but current month count with countrows is not working its gives total number of records in the table. I tried with calendar table as well but same answer. How to resolve this plz?

@Enan , for current month use

 

Current Month Count = Calculate(Count(Fact_NOAV_data[Date])filter( Fact_NOAV_data ,eomonth(Fact_NOAV_data[Date],0)=eoMonth(Today(),0) ))

 

refer

https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Dear Amit,

 

Thank you for your guidance.

Measure worked successfully.

 

Current Month Count = Calculate(Count(Fact_NOAV_data[Date]),filter( Fact_NOAV_data ,eomonth(Fact_NOAV_data[Date],0)=eoMonth(Today(),0) ))

FreemanZ
Super User
Super User

hi @Enan 

try like:

Today_Count= Calculate(COUNTROWS(Fact_NOAV_data), Fact_NOAV_data[Date]=Today())
 
Current Month Count = Calculate(COUNTROWS(Fact_NOAV_data),Month(Fact_NOAV_data[Date]=Month(Today()))

Thanks bro for helping.

todays_count is working fine with countrows.

but current month count with countrows is not working its gives total number of records in the table. I tried with calendar table as well but same answer. How to resolve this plz?

or 

Today_Count= Calculate(COUNTROWS(Fact_NOAV_data), 'Calendar'[Date]=Today())
 
Current Month Count = Calculate(COUNTROWS(Fact_NOAV_data),Month('Calendar'[Date]=Month(Today()))
if you plot with the Date column from the Calendar Table.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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