Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello,
I want to count the number of active elements between 2 dates. I have their activity start date and their activity end date.
My goal is to make a line graph with the number of active elements per day.
I must be able to integrate slicers on the type, cat, ...
A sample of data.
For example, 2021-02-12 (1 item) and 2021-02-13 (2 items)
Solved! Go to Solution.
Hi @BigLo ,
I'm so sorry that I made a mistake on the formula of measure. Is there anything else about this thread need help from my side? If it is all ok now, could you please mark it Answered now? It will help the others in the community find the solution easily if they face the same problem with you. Thank you.
Best Regards
Hi @BigLo ,
I created a sample pbix(see attachment) for you, please check whether that is what you want.
1. Create a date dimensio table
Date = CALENDAR(MIN('Table'[Start]),MAX('Table'[End]))
2. Create a measure to get the count of the active elements
Active items =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Id] ),
FILTER (
'Table',
'Table'[Start] >= SELECTEDVALUE ( 'Date'[Date] )
&& 'Table'[End] >= SELECTEDVALUE ( 'Date'[Date] )
)
)
3. Create a line chart( Axis: Date(From date dimension table) Values: Measure)
Best Regards
I think it is not correct or my explanation was not clear.
In the Beginning, all items are active.
I changed the comparison sign and everything is OK. so thanks, I never found without your help.
Hi @BigLo ,
I'm so sorry that I made a mistake on the formula of measure. Is there anything else about this thread need help from my side? If it is all ok now, could you please mark it Answered now? It will help the others in the community find the solution easily if they face the same problem with you. Thank you.
Best Regards
Hi @BigLo ,
Few questions:
Thanks,
Pragati
Thanks,
Here is the file https://1drv.ms/x/s!AnCIbCo-paOMh0xCJDd-hfe73cfL?e=EHTCoO
an item is active on the start date until the end date.
For example: the active start of id 1 is 2021-02-01 and its active end is 2022-07-03.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 33 | |
| 33 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 45 | |
| 30 | |
| 26 |