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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Cogden
Frequent Visitor

Active per month calculation with disconnected date slicer

Hi all,

 

I've tried searching around and discovered this is a fairly common problem with various solutions, though I cant seem to implement one that works.

 

I'm trying to create a visual which will show in a line chart the number of active "connections" in a given month. Our business calls case files or enquiries "connections" - but it's a similar problem to calculating active employees or something like that - we have a start date and an end date for each connection, where a connection is still open the end date will be blank.

 

I have a Date Table, a connections table and another disconnected date slicer table.

The principle is the user chooses whatever date range they want, and the measure will calcualte which connections should be active for the chosen range:

Filter Connections Worked With =
var _rangeStart=FIRSTDATE('SlicerDateTable'[Date])
var _rangeEnd=LASTDATE('SlicerDateTable'[Date])

return
IF(
SELECTEDVALUE(SQLMain[c1_startdateLT]) <= _rangeEnd
&& (
SELECTEDVALUE(SQLMain[c1_enddateLT]) >= _rangeStart || ISBLANK(SELECTEDVALUE(SQLMain[c1_enddateLT]))
),
1,0
)

 

Then this measure is used within a second measure to count the active connections:

 

Count Connections Worked With =
CALCULATE(
DISTINCTCOUNT(SQLMain[ticketnumber]),
FILTER(
SQLMain,
SQLMain[Filter Connections Worked With] = 1
)
) + 0

 

This is fine, but I cannot then work out how to show the number of connections per month on a graph due to lacking a relationship between the table with connections in it (SQLMain) and the Date Table. Naturally I dont want to create a relationship with the date table and just the start date or the end date as this wont properly show on the graph.

 

Other implementations I've seen generally dont use a disconnected date table and measure to filter the thing being counted, so I havent been able to think of a good way to achieve the result. I do need to keep the disconnected date slicer table logic however as a lot of the report is built using this logic.

 

Any help with this would be appreciated!

2 REPLIES 2
Anonymous
Not applicable

Hi All,
Firstly  lbendlin thank you for your solution!
And @Cogden to my understanding,your requirement is to dynamically calculate and display the number of active connections per month in power bi, with the ability for the user to select the date independently, and with an unrelated date filter table.

We simply apply the Date column under the same table in both the line chart and the slicer to do what you need.

vxingshenmsft_1-1723622009510.png

 

vxingshenmsft_0-1723621975269.png

If you have any other questions you can check out the PBIX file I uploaded, I hope it helps.

 

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.