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
az38
Community Champion
Community Champion

join generateseries by condition

hello!

 

Ive got a

tablePeriod =  GENERATESERIES (
DATE ( 2018, 5, 1 ),
DATE ( 2018, 5, 3 ),
TIME ( 0, 30, 0 )
)

 

and Ive got a user's session log:

session_id; session_starttime; session_endtime

 

and i need to know count(session_id) for each value from tablePeriod that >=session_starttime and <= session_endtime

 

result is a tablePeriod from two columns: Period, CountSessions

 

Thank you!

 

 


 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@az38,

 

You may use DAX below to add a calculated column.

Column =
COUNTROWS (
    FILTER (
        'session',
        'session'[session_starttime] <= tablePeriod[Value]
            && 'session'[session_endtime] >= tablePeriod[Value]
    )
)
Community Support Team _ Sam Zha
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-chuncz-msft
Community Support
Community Support

@az38,

 

You may use DAX below to add a calculated column.

Column =
COUNTROWS (
    FILTER (
        'session',
        'session'[session_starttime] <= tablePeriod[Value]
            && 'session'[session_endtime] >= tablePeriod[Value]
    )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thx, perfect!


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
az38
Community Champion
Community Champion

So, I want to define how many users were active on the server at each moment (each row) from the table tablePeriod 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.