cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

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
Resolver III
Resolver III

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.

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. 

Super User IV
Super User IV

@Jonito , 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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.