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
Anonymous
Not applicable

FILTER SELECTEDVALUE unable to conver text type into true/false

I am looking for values in a previous time range.
But the problem is i can't use my filters segments !
 
Q-1 = CALCULATE(COUNT('Client'[Client Name]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-1,Quarter),
FILTER('Client', SELECTEDVALUE('Client'[Entity])
))
 
Capture.PNG
 
 
 
 
1) My entity are the country codes : UK, US etc ... how can i perform this ?
2) Whats the difference between ALLSELECTEDVALUES and SELECTEDVALUE ? Does selectedvalue will take in count all my segments ?
5 REPLIES 5
jameszhang0805
Resolver IV
Resolver IV

I guess the Client's table is your dimension table and it is a one-to-many relationship with your fact table. If yes,
please try to put the fact table into Calculate parameter first.

Anonymous
Not applicable

Hello,

 

In fact i have a date dimension table + a client table.

if the client table is your fact table. 

please try amitchandak's method. 

amitchandak
Super User
Super User

@Anonymous , You need to do like

 

CALCULATE(COUNT('Client'[Client Name]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-1,Quarter),
FILTER('Client', 'Client'[Entity] = SELECTEDVALUE('Client'[Entity])
))

 

or

 

CALCULATE(COUNT('Client'[Client Name]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-1,Quarter),
FILTER('Client', 'Client'[Entity] in allselected('Client'[Entity])
))

 

but why you need this filter when the column name is the same, this will filter the table anyway. This is needed only when column is coming from independent table or from some other column

Anonymous
Not applicable

In fact using your previous query :

Active Total Subs = var _max = maxx(ALLSELECTED('Date'),
'Date'[Date]) return CALCULATE(COUNT('Client'[Name]), filter('Client', 'Client'[Date Begin] <= _max && 'Client'[Date End] >=_max))

I would replace -> maxx(ALLSELECTED('Date'), 'Date'[Date])
By -> LASTDATE(PREVIOUSQUARTER('Date'[Date])) and do the same for the 4 other quarter rollup.

Regards.

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.

Top Solution Authors