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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
datanau001
Helper III
Helper III

Calculate the distinct count in previous month

Dear all,

I've been trying to create a new measure to show the distinct count of values in the previous month but haven't had success.

The reason for this, is to use the previous month to calculate the increase in percentual through the months.

 

The data is based in a month column with the following values:

 

Close MonthSR Number
2018\01842
2018\02718
2018\03954
2018\04862
2018\051121
2018\061151
2018\071348

 

Would you please help me with this question?

 

Thank you 

 

 

1 ACCEPTED SOLUTION
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @datanau001,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @datanau001,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Daniel,

 

The problem has been solved with your instructions.

 

Thank you

Marcello

v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @datanau001,

Based on my test, you could refer to below measure:

Measure = var a=PREVIOUSMONTH('Table1'[Close Month])
return CALCULATE(SUM(Table1[SR Number]),FILTER(ALL('Table1'),'Table1'[Close Month]=a))

Result:

1.PNG

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors