cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nil4054 Regular Visitor
Regular Visitor

DAX help

I have my table like this

Name     Hasloggedin

A             Yes

B              Yes

C              No

D              Yes

 

I want ot return names where hasloggedin= Yes and hasloggedin=no.

If iam using DAX =Calculate(distinct(name),Hasloggedin="Yes")  I am getting an error multiple values found where single value expected, how to do it??

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: DAX help

Hi @nil4054 

Try the below

Yes = 
CONCATENATEX(
    CALCULATETABLE(
        VALUES( YourTable[Name] ),
        YourTable[Hasloggedin] = "Yes"
    ),
    YourTable[Name], ", "
)
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski



View solution in original post

4 REPLIES 4
Super User
Super User

Re: DAX help

Hi @nil4054 

You can use the below DAX measures.

Yes = 
CONCATENATEX(
    FILTER(
        YourTable,
        YourTable[Hasloggedin] = "Yes"
    ),
    YourTable[Name], ", "
)
No = 
CONCATENATEX(
    FILTER(
        YourTable,
        YourTable[Hasloggedin] = "No"
    ),
    YourTable[Name], ", "
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

nil4054 Regular Visitor
Regular Visitor

Re: DAX help

works fine but Iam having problem If i have multiple value in my name column, if i use disitnct its showing the same error (multuiple values supplied when expecting 1 value)

Super User
Super User

Re: DAX help

Hi @nil4054 

Try the below

Yes = 
CONCATENATEX(
    CALCULATETABLE(
        VALUES( YourTable[Name] ),
        YourTable[Hasloggedin] = "Yes"
    ),
    YourTable[Name], ", "
)
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski



View solution in original post

Highlighted
nil4054 Regular Visitor
Regular Visitor

Re: DAX help

works like charm, thanks

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 283 members 2,618 guests
Please welcome our newest community members: