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.
Here is an example of the type the data I'm using. Each client can have more than 1 service and I want to find clients active in a service within a time period (say between date x and date y) defined by a slicer on the report. The slicer is based off a date table created by using CALENDARAUTO(). So essentially I wanted to get a list of client references that have have a start date before y AND end date after x. Where x and y can be altered by a date slicer.
I was creating a filter on my visual using:
Solved! Go to Solution.
[# Active Clients] =
var MinReportingPeriod =
MIN( Datetable[Date] ),
var MaxReportingPeriod =
MAX( Datetable[Date] )
var Result =
COUNTROWS(
SUMMARIZE(
CALCULATETABLE(
ServiceInfo,
KEEPFILTERS(
ServiceInfo[Start Date]
<= MaxReportingPeriod
),
KEEPFILTERS(
MinReportingPeriod
<= ServiceInfo[End Date]
)
),
ServiceInfo[Client Ref]
)
)
return
Result
@Anonymous
If you are referring to:
Sorry for all the confusion!
I'm talking about my measure. Did you see it? 'Cause I have a feeling you didn't...
Apologies for wasting your time. I didn't apply it correctly the first time and didn't realise you could add it to a filter plane as a count. Thank you for your help!!
[# Active Clients] =
var MinReportingPeriod =
MIN( Datetable[Date] ),
var MaxReportingPeriod =
MAX( Datetable[Date] )
var Result =
COUNTROWS(
SUMMARIZE(
CALCULATETABLE(
ServiceInfo,
KEEPFILTERS(
ServiceInfo[Start Date]
<= MaxReportingPeriod
),
KEEPFILTERS(
MinReportingPeriod
<= ServiceInfo[End Date]
)
),
ServiceInfo[Client Ref]
)
)
return
Result
HI @Anonymous, using the above gave a count of the acive clients but what I want is a list of the client references of those clients who are active. Am I applying it wrong?
Thanks
Elin
A measure can't return a table, only a scalar. When you say "a list of client references", what do you actually mean in this context? All you can return from a measure that imitates a list of values is a string with the values concatenated by using the CONCATENATEX function.
You can take my code from above and instead of returning the count of active clients, you can use the function to return a list of references as explained before.
Hi @Anonymous
Sorry for not being very clear. I would like a filter to be applied to a table/matrix visual so when i put in client ref as one of the values it will only show me client references of client who are active at any point during the repoting period.
Thanks
Elin
It so happens the the filter you need is already there above. Just use the measure in the Filter Pane with the condition [the measure] = 1 and you'll filter for all the active clients in the current context.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
32 | |
30 | |
18 | |
18 |