• Skip to main content
  • Skip to footer

Curbal

Learn how to grow your business with your data and Power BI

  • Resources
    • DAX Glossary
    • Download Center
    • Template Apps
    • Data Stories Gallery
    • Solution Gallery
    • Learning Resources
  • Courses
    • Introduction to Power BI – FREE Online course
    • Power Query Online Training for Power BI
    • M Language Online Course: The unofficial and Practical Reference Guide
  • Blog
  • Shop
    • Courses
    • Swag
    • Template Apps
    • Donations
  • Cart
  • Register/ Log In
    • Become a Member
    • Log In
    • My account
    • My Courses
  • Contact
You are here: Home / CM Tooltip Glossary Pro+ / HASONEVALUE

HASONEVALUE

posted on October 2, 2017

« Back to Glossary Index

Syntax

HASONEVALUE(<columnName>)

Tutorial with example

Have you ever got this error message?: A table of multiple values was supplied where a single value was expected ?

If you have, make sure to check out this video to understand how to solve it.

HASONEVALUE is a DAX function that will check if the table returned has one value or not. If it has, it will return TRUE() otherwise it will return false.
HASONEVALUE is syntax sugar or equivalent of COUNTROWS(VALUES(ColumnName))=1

Download example file:

Link to Power BI file: here.

Remarks

  • An equivalent expression for HASONEVALUE() is COUNTROWS(VALUES(<columnName>)) = 1.
Was this helpful?
[Total: 7   Average: 4.3/5]
See Also:
  • SELECTEDVALUE
« Back to Index

Reader Interactions

Comments

  1. Augusto Berg

    January 12, 2019 at 4:23 pm

    Thanks from Brazil Ruth !

    Reply
    • Ruth Pozuelo Martinez

      January 12, 2019 at 7:55 pm

      Thanks!
      /Ruth

      Reply
  2. Jose Fernando Morales Ayala

    November 10, 2018 at 5:03 pm

    Hola Ruth.
    Recibe una felicitacion por tu MVP…
    Apenas ayer vi uno de tus videos ¿Dax /BI?, estas aplicaciones son nuevas, no sabia de su existencia¿es acaso un super excel?

    Muy interesante sinembargo necesito el ABC (alfa) para empezar con mis pininos en estas aplicaciones ¿que videos tuyos me recomiendas?

    Saludos desde Monterrey N.L., Mexico

    Reply
    • Ruth Pozuelo Martinez

      November 11, 2018 at 4:13 pm

      Hola Jose,
      Empieza aqui, es totalmemte gratis:
      https://curbal.com/blog/course/high-level-introduction-to-power-bi
      /Ruth

      Reply

Let us know your thoughts... Cancel reply

Footer CTA

Join our community of +20,000 professionals

Become a Member

Subscribe to YouTube

About us

Curbal AB
Kopparbergsvägen, 10
722 13 – Västerås
Sweden

OrgNo: 5569680852 | VAT: SE556968085201

 

Location:

© Copyright 2014-2021 · Curbal AB · All Rights Reserved · Privacy Policy · Terms of Service · Refund Policy · Log In