Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Ethanhunt123
Helper IV
Helper IV

Filter to check my value is of integer type

I want to distinct count my account number where depositor name is in an integer format.

1 ACCEPTED SOLUTION

Hi @Ethanhunt123 ,

 

You can do it with a combination of Power Query and DAX.

 

In Power Query

 

add a custom column and use this formula

 

= Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.RemoveNulls(List.Transform(Text.ToList([Name]),each if Value.Is(Value.FromText(_), type text) then _ else null))))

 

Then Change the type to Text

 

1.jpg

 

 

You can then use a DAX Measure

 

counti =
CALCULATE(DISTINCTCOUNT('Table'[Account number]),FILTER('Table','Table'[Custom] = BLANK()))
 
 
2.JPG

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

View solution in original post

8 REPLIES 8
harshnathani
Community Champion
Community Champion

Hi @Ethanhunt123 ,

 

You can check ISNONTEXT(), ISNUMBER(), NOT(ISTEXT())

 

 

https://dax.guide/isnumber/

https://dax.guide/isnontext/

https://dax.guide/istext/

https://dax.guide/not

 

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

 

parry2k
Super User
Super User

@Ethanhunt123 without looking at the data very hard to say what you are trying to do but here is a measure

 

Unique Count = DISTINCTCOUNT ( Table[Column] )

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I know about the distinct count. I am stuck in the filter part. 

Dax = DistinctCount(Table[Column]), filter(table,table[Column1] = (Count when my column1 is an integer)

Hi @Ethanhunt123 ,

 

Not sure what you mean.

Does COLUMN1 contain multiple formats ie does a single column contain text, integers ??

 

Please share sample data to help you.

 

Regards,

HN

 

 

Account numberName
12345Steven
2345Steven1
87921123

 

Output - 1

Hi @Ethanhunt123 ,

 

You can do it with a combination of Power Query and DAX.

 

In Power Query

 

add a custom column and use this formula

 

= Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.RemoveNulls(List.Transform(Text.ToList([Name]),each if Value.Is(Value.FromText(_), type text) then _ else null))))

 

Then Change the type to Text

 

1.jpg

 

 

You can then use a DAX Measure

 

counti =
CALCULATE(DISTINCTCOUNT('Table'[Account number]),FILTER('Table','Table'[Custom] = BLANK()))
 
 
2.JPG

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

Hi @Ethanhunt123 , 

You could  refer to my sample for details.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNjFV0lEKLkktS81TitWJVkIRMQQLWZhbGhkCxYCqoUoMjUH84mJDmBYgMgapMDUxNTFTio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Account number" = _t, Name = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Account number", Int64.Type}, {"Name", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.RemoveNulls(List.Transform(Text.ToList([Name]),each if Value.Is(Value.FromText(_), type number) then _ else null))))
in
    #"Added Custom"

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

It contains alphanumeric, string, integer all type f value. But I want to calculate only for the integer value.

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.