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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RichOB
Post Partisan
Post Partisan

I need active numbers per month and a filter included please

Hi, I need to get the number of active clients per month (from table 1) and have the ability to filter the numbers by table 2.  Table 1 has the end date to get the active number per month, and Table 2 has the data I want to filter by

 

Table 1

NameCreated_DateEnd_DateID
Dave01/04/202401/12/20241
Mark02/05/202430/07/20242
Jodie03/06/202412/08/20243
Mary05/06/202401/09/20244
Gavin07/06/202411/08/20245
Holly01/08/202401/10/20246
Abby01/09/202401/20/20247
Bob01/10/202401/12/20248
Bill01/11/202431/12/20249
Jill01/05/202401/11/202410

 

Table2

NameCreated_DateIDLocationEye_Colour
Dave01/04/20241ManchesterBrown
Mark02/05/20242ManchesterBlue
Jodie03/06/20243ManchesterBrown
Mary05/06/20244ManchesterBlue
Gavin07/06/20245EdinburghBrown
Holly01/08/20246EdinburghBlue
Abby01/09/20247ManchesterGreen
Bob01/10/20248EdinburghGreen
Bill01/11/20249EdinburghBrown
Jill01/05/202410Manchester

Brown

 

For example, the full active clients per month are:
April 1

May 2

June 6

July 6

August 6

 

Active clients in June

Brown Eyes 4

Blue eyes 2

Green 0

 

Thanks!

 

 

2 ACCEPTED SOLUTIONS

Table = 
var t1 = SELECTCOLUMNS('Table 1',"Name",[Name],"Created_Date",[Created_Date],"End_Date",[End_Date],"ID",[ID] & "")
var t2 = SELECTCOLUMNS('Table 2',"Location",[Location],"Eye Colour",[Eye_Colour],"ID",[ID] & "")
return NATURALINNERJOIN(t1,t2)

lbendlin_0-1744666643538.png

 

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

Assuming there will never be repetitions in the ID column of Table2, create a relationship (Many to One and Single) from the ID column of Table1 to the ID column of Table2.  Then follow the technique shown in the attached file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

9 REPLIES 9
HarishKM
Memorable Member
Memorable Member

@RichOB Hey,
Kindly refer below blog for your reference as this person has similer problem- Solved: Calculate Number of Active Clients by Month - Microsoft Fabric Community

HR Analytics - Active Employee, Hire and Terminati... - Microsoft Fabric Community

 

Thanks
Harish M
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

 

 

v-kpoloju-msft
Community Support
Community Support

Hi @RichOB,
Thank you for reaching out to the Microsoft fabric community forum. Thank you @Ashish_Mathur @lbendlin, for your inputs on this issue.

After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.    

Dax Measure for Creating Active Clients in the Table :

Active Clients =

CALCULATE(

    DISTINCTCOUNT('Table'[ID]),

    FILTER(

        'Table',

        'Table'[Created_Date] <= MAX(DateTable[Date]) &&

        'Table'[End_Date] >= MIN(DateTable[Date])

    )

)


I am also including .pbix file for your better understanding, please have a look into it:

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Thank you for using Microsoft Community Forum.

Hi @RichOB,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

Hi @RichOB,


I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

Hi @RichOB,


I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.


Thank you.

Ashish_Mathur
Super User
Super User

Hi,

Assuming there will never be repetitions in the ID column of Table2, create a relationship (Many to One and Single) from the ID column of Table1 to the ID column of Table2.  Then follow the technique shown in the attached file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

What's the reason for having two tables? This can all go into a single table.  

 

Then add a calendar table and create a measure that computes if a particular user was active in the specified date

range.

 

Note:  "01/20/2024"  is not a valid en-GB date,  did you mean "20/01/2024"  ?

Hi @lbendlin in my real-life scenario it's in two tables from 2 systems. What is the easiest way to combine, please? Ah yes it should say 20/01/2024.

 

Thanks

Table = 
var t1 = SELECTCOLUMNS('Table 1',"Name",[Name],"Created_Date",[Created_Date],"End_Date",[End_Date],"ID",[ID] & "")
var t2 = SELECTCOLUMNS('Table 2',"Location",[Location],"Eye Colour",[Eye_Colour],"ID",[ID] & "")
return NATURALINNERJOIN(t1,t2)

lbendlin_0-1744666643538.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.