Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Community,
I want to create a line chart showing the number of users based on their start and end contracts for exemple I have on January 15 users on february 13 because two their contracts ended.
I have two datasets one is users and the other one is date
I create two relationships one is active contract_start and date_actual and one is inactive contract_end and date_actual
then I tried to this measure =
Solved! Go to Solution.
Hi @Anonymous ,
First, please don't create any relationship between TEMPS and USER and create a measure as below:
Measure =
VAR _curdate=MAX('TEMPS'[date_actual])
return
CALCULATE (
DISTINCTCOUNT( 'USER'[user_id] ),
FILTER (
'USER',
(
'USER'[date_debut_ctrt] <=_curdate
&& (
'USER'[date_fin_ctrt] >= _curdate
|| ISBLANK ( 'USER'[date_fin_ctrt] )
)
)
)
)
Best regards
Rena
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
Hi @Anonymous ,
First, please don't create any relationship between TEMPS and USER and create a measure as below:
Measure =
VAR _curdate=MAX('TEMPS'[date_actual])
return
CALCULATE (
DISTINCTCOUNT( 'USER'[user_id] ),
FILTER (
'USER',
(
'USER'[date_debut_ctrt] <=_curdate
&& (
'USER'[date_fin_ctrt] >= _curdate
|| ISBLANK ( 'USER'[date_fin_ctrt] )
)
)
)
)
Best regards
Rena
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
@Anonymous , refer if my blog on a similar topic can help
Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.
User | Count |
---|---|
77 | |
75 | |
46 | |
31 | |
28 |
User | Count |
---|---|
99 | |
93 | |
50 | |
49 | |
46 |