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
Saichebrolu
Frequent Visitor

Need help in How to fetch the prior month property ID count

PropertyIDCreated DateMAXdate of id by month
ABC7/20/20237/20/2023
ABC7/19/2023 
ABC6/15/20236/15/2023
XYZ5/12/2023 
XYZ5/20/20235/20/2023
XYZ6/10/20236/10/2023
XYZ7/1/20237/1/2023

 

Hello Community, Need help
i have a above table with Propertyid,Createddate.
By using those 2 columns i have created a calculated column that will return the max creatd date of each property id.
Now if i apply count on the [MAXdate of id by month]
count([MAXdate of id by month])= We get 5
>>if we select june month in the month slicer we get count 2
ie. 

ABC 6/15/2023 6/15/2023


XYZ 6/10/2023 6/10/2023
>>if we select july month in the month slicer we get count 2

ABC 7/20/2023 7/20/2023


XYZ 7/1/2023
7/1/2023

 

According to our table data present till the july month.
Myrequirment: if i select any month after the july in 2023 i should get the count of july month. how to achive this.
either August,September,October....December.


Need help

Thanks.



 
 

1 ACCEPTED SOLUTION
rubayatyasmin
Super User
Super User

Hi, @Saichebrolu 

 

You can achieve this by creating a measure that checks the maximum date in your dataset against the selected month. 

 

for example: meas1 =  MAX(table[creat date])

 

then extract month from meas1.  like: MONTH([meas1])

 

then Create a measure for the selected month in the slicer

SelectedMonth = MONTH(MAX('TableName'[Created Date]))

 

lastly, create a measure that will give you the count based on the conditions you provided:

 

DesiredCount =
IF(
[SelectedMonth] <= [MaxDateMonth],
COUNT('TableName'[MAXdate of id by month]),
CALCULATE(
COUNT('TableName'[MAXdate of id by month]),
FILTER(
'TableName',
MONTH('TableName'[Created Date]) = [MaxDateMonth]
)
)
)

 

something like this.

 

Hope that helps. 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


View solution in original post

1 REPLY 1
rubayatyasmin
Super User
Super User

Hi, @Saichebrolu 

 

You can achieve this by creating a measure that checks the maximum date in your dataset against the selected month. 

 

for example: meas1 =  MAX(table[creat date])

 

then extract month from meas1.  like: MONTH([meas1])

 

then Create a measure for the selected month in the slicer

SelectedMonth = MONTH(MAX('TableName'[Created Date]))

 

lastly, create a measure that will give you the count based on the conditions you provided:

 

DesiredCount =
IF(
[SelectedMonth] <= [MaxDateMonth],
COUNT('TableName'[MAXdate of id by month]),
CALCULATE(
COUNT('TableName'[MAXdate of id by month]),
FILTER(
'TableName',
MONTH('TableName'[Created Date]) = [MaxDateMonth]
)
)
)

 

something like this.

 

Hope that helps. 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


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
Top Kudoed Authors