Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello all
I hope everyone's ok, safe and healthy.
I have this simple measure that calculates the distinctcount of a contract, by a certain date
Solved! Go to Solution.
Hi @pedroccamaraDBI ,
Maybe you can try just put it into filter pane and set the measure show itmes which is 1 or 2 or 10.
But if you want use slicer to control this number, a table contains all the number from 1 to max(distinctcount( contractID])) is necessary. Create this table via this code below:
Then you need to create a measure named slicer for your visual.
slicer =
IF (
[Contracts (by initial risk date)] >= MIN ( slicer[Value] )
&& [Contracts (by initial risk date)] < = MAX ( 'slicer'[Value] ),
1,
0
)
Let it in filter pane on this visual and configure it show items is 1. Pbix file in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @pedroccamaraDBI,
I apologize as I made some mistakes.
Change "+" -> "=".
Of course SELECTEDVALUE() works too, but you can only select one value instead of a range. If COUNTROWS(VALUES(slicer[Value])) > 1, then SELECTEDVALUE will get blank.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @pedroccamaraDBI ,
Maybe you can try just put it into filter pane and set the measure show itmes which is 1 or 2 or 10.
But if you want use slicer to control this number, a table contains all the number from 1 to max(distinctcount( contractID])) is necessary. Create this table via this code below:
Then you need to create a measure named slicer for your visual.
slicer =
IF (
[Contracts (by initial risk date)] >= MIN ( slicer[Value] )
&& [Contracts (by initial risk date)] < = MAX ( 'slicer'[Value] ),
1,
0
)
Let it in filter pane on this visual and configure it show items is 1. Pbix file in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-chenwuz-msft
Fantastic idea! It's working.
I had to change that Generateseries measure,
GENERATESERIES(1,MAX(Contracts[ContractID]))
and also took out the plus (+) sign.
One last question, from what i've seen and read, wouldn't it be better with SELECTEDVALUE?
Just asking because i wouldn't know how to do it
Hi @pedroccamaraDBI,
I apologize as I made some mistakes.
Change "+" -> "=".
Of course SELECTEDVALUE() works too, but you can only select one value instead of a range. If COUNTROWS(VALUES(slicer[Value])) > 1, then SELECTEDVALUE will get blank.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@pedroccamaraDBI , Try a meausre like
Client GT contract NO =
var _cnt = CALCULATE(
DISTINCTCOUNT ( 'Contracts'[Contractid]),
USERELATIONSHIP( Dates[Date],'Contracts'[INRiskDate]) )
var _no =2
return
countx(filter(summarize('Contracts',Clinet[client], "_1",_cnt),[_1] >= _no),[Clinet])
Hello @amitchandak
The first part it's clear that's my measure above.
Could you please explain the 2nd part, the countx?
For some reason it's not working and it shows me a value but i can't put it on a filter
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 |
---|---|
14 | |
10 | |
10 | |
10 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |