Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext 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
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:
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
Solved! Go to Solution.
@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 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.
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
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.
@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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |