Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I'm struggling with some, in my opinion, very easy problem.
There is a table with items including creation and delete date
Item | creation date | deletion date |
1 | April | April |
2 | May | April |
3 | April | May |
.. | ... |
I'd like to have two measures, where I can select for example "April",
and I get measure "all_created" and "all_closed" for this month .
one my formular see below. the problem here is, it is filtered by creation_date also
TASK (SRQ) - parent Object closed date =
CALCULATE(
DISTINCTCOUNT('ServiceReq'[Number]),
FILTER(ServiceReq,
('ServiceReq'[Closed Date]) >= MIN('Closed Date'[Date]) &&
('ServiceReq'[Closed Date]) <= MAX('Closed Date'[Date])
))
can anybody help in this case?
Hi @cousinitt13 ,
I am not sure if I understood your question correctly. If I use the ALL function, it does not remove the filter on table 'Closed Date'. Could you please share your calculation results?
parent Object closed date =
CALCULATE (
DISTINCTCOUNT ( 'ServiceReq'[Number] ),
FILTER (
ALL ( ServiceReq ),
( 'ServiceReq'[Closed Date] ) >= MIN ( 'Closed Date'[Date] )
&& ( 'ServiceReq'[Closed Date] ) <= MAX ( 'Closed Date'[Date] )
)
)
parent Object created date =
CALCULATE (
DISTINCTCOUNT ( 'ServiceReq'[Number] ),
FILTER (
ALL ( ServiceReq ),
'ServiceReq'[Created Date] >= MIN ( 'Created Date'[Date] )
&& 'ServiceReq'[Created Date] <= MAX ( 'Created Date'[Date] )
)
)
Best Regards,
Winniz
Hi @cousinitt13
You need only one disconnected date table
TASK (SRQ) - parent Object closed date =
CALCULATE (
DISTINCTCOUNT ( 'ServiceReq'[Number] ),
'ServiceReq'[Closed Date] >= MIN ( 'Date'[Date] ),
'ServiceReq'[Closed Date] <= MAX ( 'Date'[Date] )
)
TASK (SRQ) - parent Object open date =
CALCULATE (
DISTINCTCOUNT ( 'ServiceReq'[Number] ),
'ServiceReq'[Open Date] >= MIN ( 'Date'[Date] ),
'ServiceReq'[Open Date] <= MAX ( 'Date'[Date] )
)
Not having the opportunity to create relationships and new tables
Alright, I guess in this case also REMOVEFILTERS function is not available. Then you can use one of the date tables in the slicer (I guess better than using two slicers) and use this code
TASK (SRQ) - parent Object open date =
CALCULATE (
DISTINCTCOUNT ( 'ServiceReq'[Number] ),
ALL ( 'Created Date' ),
ALL ( 'Closed Date' ),
'ServiceReq'[Open Date] >= MIN ( 'Closed Date'[Date] ),
'ServiceReq'[Open Date] <= MAX ( 'Closed Date'[Date] )
)
TASK (SRQ) - parent Object Created date =
CALCULATE (
DISTINCTCOUNT ( 'ServiceReq'[Number] ),
ALL ( 'Created Date' ),
ALL ( 'Closed Date' ),
'ServiceReq'[Created Date] >= MIN ( 'Closed Date'[Date] ),
'ServiceReq'[Created Date] <= MAX ( 'Closed Date'[Date] )
)
Hello,
Thanks for the quick answer. I'm understanding this way you sent me, my problem is, I didn't have the possibility to create this datetable cause of restrictions of this dataset.
is there any other way??
If I use the ALL() function, the "closed date" filter seems to be ignored
BR
this is the relation model
@cousinitt13 , If you need close and created on the same period you can work with one date table with Active inactive join and userelationship (to be used in measure)
refer example
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
10 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
8 |