cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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()))

2 ACCEPTED SOLUTIONS
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()))
Super User

@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...

6 REPLIES 6
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?

Super User

@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...

Helper I

Dear Amit,

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) ))

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()))
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?

Super User

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.

Announcements

#### Power BI Monthly Update - November 2023

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

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors