March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have columns ID, Name.
I'm using Text Filter to enter ID and filter the charts.
Requirement: I want the card to show Emp Name, if Length of the ID in the Text filter is equal to 10 characters.
Solved! Go to Solution.
Hello @ARUNTKAP,
Please try following measure:
EmpName =
VAR SelectedID = SELECTEDVALUE(Table[ID])
VAR IDLength = LEN(SelectedID)
VAR EmpName = CALCULATE(MIN(Table[Name]),FILTER(Table,Table[ID]=IDLength))
RETURN IF(IDLength>=10,EmpName,BLANK())
Hope this helps.
Hi @ARUNTKAP
Do you mean length of text used for seraching or length of result you get after search.
Example
your ids are
12345
45789
You type 123
So you are checking length of 123 or length of 12345?
If you are checking lengh of 123 then its not possible as text slicer is just used for searching purpose.
IF you want to check lenght of result after search that is 12345 then use below dax.
Hello @ARUNTKAP,
Please try following measure:
EmpName =
VAR SelectedID = SELECTEDVALUE(Table[ID])
VAR IDLength = LEN(SelectedID)
VAR EmpName = CALCULATE(MIN(Table[Name]),FILTER(Table,Table[ID]=IDLength))
RETURN IF(IDLength>=10,EmpName,BLANK())
Hope this helps.
Small correction I did to get the answer:
Instead of FILTER(Table,Table[ID]=IDLength))
FILTERTable,Table[ID]=selectedId))
Hi @ARUNTKAP
Do you mean length of text used for seraching or length of result you get after search.
Example
your ids are
12345
45789
You type 123
So you are checking length of 123 or length of 12345?
If you are checking lengh of 123 then its not possible as text slicer is just used for searching purpose.
IF you want to check lenght of result after search that is 12345 then use below dax.
Hi @Anonymous
Thanks for your input. I shall use your dax formulas in future, for my other need.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |