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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Elisa112
Helper V
Helper V

Distinct count rows based on condition

Hello Experts 

I am trying to find the count of rows in a table for this month and last month based on a condition but I am getting incorect figures.

Calls this month:

Client Appointed = CALCULATE(
        DISTINCTCOUNT('Calls'[Call ID]),
        FILTER('Calls',MONTH('Calls'[Call Date])=MONTH(TODAY()) && 'Calls'[Outcome] = "appointed"))
 
I also need to find appointed calls last month
 
any suggestions greatly appreiated, thanks in advance
 


1 ACCEPTED SOLUTION
grazitti_sapna
Super User
Super User

Hi @Elisa112,
Please refer to the DAX calculations below for the current and previous month's call volume:

Current Month Calls:
Calls in Current month =
CALCULATE(
DISTINCTCOUNT('Calls'[Call ID]),
FILTER('Calls',
MONTH('Calls'[Call Date]) = MONTH(TODAY()) &&
YEAR('Calls'[Call Date]) = YEAR(TODAY()) &&
'Calls'[Outcome] = "appointed"
))

Previous Month Calls:

Calls in Previous month =
CALCULATE(
DISTINCTCOUNT('Calls'[Call ID]),
FILTER('Calls',
MONTH('Calls'[Call Date]) = MONTH(TODAY()) - 1 &&
YEAR('Calls'[Call Date]) = YEAR(TODAY()) &&
'Calls'[Outcome] = "appointed"
))
I believe this will achieve the desired outcome.

Thank you

View solution in original post

6 REPLIES 6
grazitti_sapna
Super User
Super User

Hi @Elisa112,
Please refer to the DAX calculations below for the current and previous month's call volume:

Current Month Calls:
Calls in Current month =
CALCULATE(
DISTINCTCOUNT('Calls'[Call ID]),
FILTER('Calls',
MONTH('Calls'[Call Date]) = MONTH(TODAY()) &&
YEAR('Calls'[Call Date]) = YEAR(TODAY()) &&
'Calls'[Outcome] = "appointed"
))

Previous Month Calls:

Calls in Previous month =
CALCULATE(
DISTINCTCOUNT('Calls'[Call ID]),
FILTER('Calls',
MONTH('Calls'[Call Date]) = MONTH(TODAY()) - 1 &&
YEAR('Calls'[Call Date]) = YEAR(TODAY()) &&
'Calls'[Outcome] = "appointed"
))
I believe this will achieve the desired outcome.

Thank you

thank you!

Hello

thank you but I am still getting incorrect figures, with the condition (appointed) I am getting the same figures without the condition.

any ideas?

thanks

rajendraongole1
Super User
Super User

Hi @Elisa112 -Can you please check the below logic.month(today()) will works.

 

Calls This Month =
CALCULATE(
DISTINCTCOUNT('Calls'[Call ID]),
FILTER(
'Calls',
MONTH('Calls'[Call Date]) = MONTH(TODAY()) &&
YEAR('Calls'[Call Date]) = YEAR(TODAY()) &&
'Calls'[Outcome] = "appointed"
)
)

 

Hope this helps.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hello

thank you but I am still getting incorrect figures, with the condition (appointed) I am getting the same figures without the condition.

any ideas?

thanks

Hi @Elisa112 -if possible, can you please share the working data pbix file by removing the sensitive data or sample data in excel copy for reference.

Calls This Month =
CALCULATE(
DISTINCTCOUNT('Calls'[Call ID]),
'Calls'[Outcome] = "appointed",
MONTH('Calls'[Call Date]) = MONTH(TODAY()),
YEAR('Calls'[Call Date]) = YEAR(TODAY())
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.