Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have two tables: a table with customers active in a calendar month and a table of transactions with start and end dates. I want to make a Power BI table that lists the customers and, when filtered by a calendar month, counts the number of transactions that were running during any part of the calendar month. I cannot think of how to do this because I need to link the tables by both customer number and dates? Any help would be appreciated!
Table 1
Table Two
Desired Output
Solved! Go to Solution.
Hi, @paulsnet1986
You can try the following methods.
Measure:
Count =
VAR _selectedmonth = MONTH ( SELECTEDVALUE ( Table1[Calender Month] ) )
VAR _Count1 = CALCULATE ( COUNT ( Table2[Transaction] ), FILTER ( ALL ( Table2 ),
MONTH ( [Start Date] ) <= _selectedmonth && [End Date] = BLANK ()
&& [Customer] = SELECTEDVALUE ( Table1[Active Customers] ) ) )
VAR _Count2 = CALCULATE ( COUNT ( Table2[Transaction] ), FILTER ( ALL ( Table2 ),
MONTH ( [Start Date] ) <= _selectedmonth && MONTH ( [End Date] ) >= _selectedmonth
&& [Customer] = SELECTEDVALUE ( Table1[Active Customers] ) ) )
RETURN
_Count1 + _Count2 + 0
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @paulsnet1986
You can try the following methods.
Measure:
Count =
VAR _selectedmonth = MONTH ( SELECTEDVALUE ( Table1[Calender Month] ) )
VAR _Count1 = CALCULATE ( COUNT ( Table2[Transaction] ), FILTER ( ALL ( Table2 ),
MONTH ( [Start Date] ) <= _selectedmonth && [End Date] = BLANK ()
&& [Customer] = SELECTEDVALUE ( Table1[Active Customers] ) ) )
VAR _Count2 = CALCULATE ( COUNT ( Table2[Transaction] ), FILTER ( ALL ( Table2 ),
MONTH ( [Start Date] ) <= _selectedmonth && MONTH ( [End Date] ) >= _selectedmonth
&& [Customer] = SELECTEDVALUE ( Table1[Active Customers] ) ) )
RETURN
_Count1 + _Count2 + 0
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
please provide data in text format.
Proud to be a Super User!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
57 | |
36 | |
31 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |