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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Michael85
Regular Visitor

Issue with incorrect results of a DAX for sharepoint list multi choice field.

Good day,

 

I have a bit of an issue with a DAX that is supposed to count the amount of times a choice appears in a multi choice column of a sharepoint List. 

 

Basically,

I created a table with the choices of the multi choice column using the following:

 

FlightDispatchCategories = DATATABLE(
    "Category", STRING,
    {
        {"Baggage"},{"Loading/unloading"},{"Cleaning"},{"Fueling"},
        {"Flight Plan"},{"ATC"},{"Customs"},{"Parking Congestion"},
        {"Missing Authorisation/Permit"},{"Weather"},{"Diversion"},{"Other"}
    }
)

Then I use the following DAX to calcuate each time one appears:

Flight CAT = 
SUMX(
    'Duty Manager Event Log',
    IF(
        CONTAINSSTRING('Duty Manager Event Log'[PurpleType], SELECTEDVALUE('FlightDispatchCategories'[Category])), 
        1, 
        0
    )
)

 

This somehow returns incorrect values.  Some with too much and some are missing. See below:

 

 

Michael85_0-1739034524872.png

 

In the above chart, there should be additionnal categories and the one displayed as 14 should actually be "10". 

 

The weird thing is that I did the exact same thing for another field in the same project and it worked fine. 

 

I would appreciate any insights as I have been struggling with this issue for a week now. 

 

Thank you

1 ACCEPTED SOLUTION
Michael85
Regular Visitor

@Anonymous  and @parry2k 

 

Thank you for your responses.

Unfortunately none seem to work. 

 

However I was able to find another method using reference Queries and grouping the data.

 

For now it seems to work. 

 

Thank you again for your help. 

Edit:   To solve the issue, I went into "transform data". 

Right clicked on my data table, used the reference option.  Using the now created reference query I was able to "expand to new rows" in the Multi choice column. 

 

Finally, I used the "group by" option in the transform menu.  This created a count of every choice which I was able to use in visuals. 

 

View solution in original post

4 REPLIES 4
Michael85
Regular Visitor

@Anonymous  and @parry2k 

 

Thank you for your responses.

Unfortunately none seem to work. 

 

However I was able to find another method using reference Queries and grouping the data.

 

For now it seems to work. 

 

Thank you again for your help. 

Edit:   To solve the issue, I went into "transform data". 

Right clicked on my data table, used the reference option.  Using the now created reference query I was able to "expand to new rows" in the Multi choice column. 

 

Finally, I used the "group by" option in the transform menu.  This created a count of every choice which I was able to use in visuals. 

 

Anonymous
Not applicable

Hi @Michael85 

It is glad that you solved your problem, you can accept you own answer as a solution so that more user can refer to, and if it is convenient for you, you can share your ways here so that it will help more user to solve the similar problem.

 

Best Regards!

Yolo Zhu

Anonymous
Not applicable

Hi,

Thanks for the solution parry2k  offered, and i want to offer some more information for user to refer to.

hello @Michael85 , you can change the measure to the following.

MEASURE =
COUNTROWS (
    FILTER (
        'Duty Manager Event Log',
        CONTAINSSTRING (
            [PurpleType],
            SELECTEDVALUE ( 'FlightDispatchCategories'[Category] )
        )
    )
)

 

Best Regards!

Yolo Zhu

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

 

parry2k
Super User
Super User

@Michael85 change SELECTEDVALUE  with MAX and see if it works.



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.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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