Forum Discussion
Selection between two dates
- 6 years ago
By VS 2017 it seems like you are refering to Visual studio, is that correct? Which version of VS you have should not matter, but you need to check the version of your SSAS installation:
to check the SSAS version go to SSMS -- connect to SSAS instance --> reports -> standard reports --> General and there would be the version for you
But perhaps more important , it does not work in direct query:
https://community.powerbi.com/t5/Desktop/SELECTEDVALUE-not-a-valid-function/td-p/270639
you can rewrite by using the hasonevalue-function
Hi Anonymous
try this for your measure:
ClientsOnDate :=
VAR SELECTEDDATE =
SELECTEDVALUE ( Dim_REF_Date[BK_Date] )
RETURN
CALCULATE (
DISTINCTCOUNT ( 'Fct_JGZ'[ClientNumber] );
FILTER (
'Fct_JGZ';
SELECTEDDATE > FCT_JGZ[StartDate]
&& SELECTEDDATE < FCT_JGZ[EndDate]
)
)
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
Hi sturlaws
Thank you for your reply.
However, the formula does not seem to work. In my report, it just says 'can't display the visual'.
It can't seem to resolve the BK_date as Selectedvalue.
- Anonymous6 years agoNot applicable
Thanks a lot, I had also tried to create my model in pbi deskstop. But again, the formula works in PBI desktop, but not in my live connected SSAS model.
Is SELECTEDVALUE supported for live connections? And if not, are there other ways to do this?- sturlaws6 years ago
Resident Rockstar
Which version of SSAS are you running?
According to this: https://dax.guide/selectedvalue/ selectedvalue is supported in SSAS 2017 and 2019