The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
23 | |
14 | |
13 | |
10 | |
8 |