cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NJ81858
Helper III
Helper III

Counting per Month

I am trying to calculate the number of occurances per month. The 'Data Date' field is the month that the data was pulled and the 'Redemption Date' is the date that I am trying to count the number of occurances for. So essentially what I want is the number of 'Redemption Date' for each 'Data Date'. This is what I have so far and it is not giving me the correct answer, so any help would be appreciated!

CD Measure.PNG

3 REPLIES 3
tamerj1
Super User
Super User

Hi @NJ81858 
It depends on the filter context of your viual. However, yoy may try

Redemption Count =
SUMX (
    VALUES ( 'CD Data'[Data Date] ),
    COUNTROWS ( CALCULATETABLE ( VALUES ( 'CD Data'[Redemption Date] ) ) )
)
Greg_Deckler
Super User
Super User

@NJ81858 Put your Data Date field into a table visual along with any other stuff you want. Create a measure like:

Measure = COUNTROWS('CD Data')

Or

Measure = COUNTROWS(DISTINCT('CD Data'[Redemption Date]))

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@NJ81858 , Have a separate date table joined with Redemption Date

 

calculate(countrows(Table), filter(all('Date'), Date[Month Year] = max(Date[Month Year]) ) )

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power BI Dev Camp Session 27

Ted's Dev Camp

This session walks through creating a new Azure AD B2C tenant and configuring it with user flows and custom policies.