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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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