Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
In a Power Bi report, connected to Dynamics 365 environment by direct query, i need to count how many times a single value (1) of a multiselect field appears in the column.
Examining the input data, I found that the values have the following format:
I tried with the following expression, but it counts every single row:
Single option = CALCULATE(COUNTROWS(campaign), NOT(ISBLANK(FIND("1", campaign[Multiselect Field]))))
I also tried with this other expression, and count only rows that has the single value "1":
Single option = CALCULATE(COUNTROWS(campaign),CONTAINSSTRING("1", campaign[Destinatari Campagna]))
Can someone help me?
Solved! Go to Solution.
Hi, @Pwrbi_usr
Thank you very much for your reply. Since the summary will ignore the rows that have the same value. I modified this DAX expression:
This way rows with the same value will not be ignored, and the final DAX expression will look like this:
Has1value =
VAR _table = ADDCOLUMNS(CALCULATETABLE('Table'),"a",FIND(1,'Table'[Column1],1,0))
RETURN COUNTAX(FILTER(_table,[a] <>0),'Table'[Column1])
I've uploaded the PBIX file I used this time below.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Pwrbi_usr
Based on your description, I've created the following sample data:
Using the Find function is the right choice. First, I created a dummy table in my measure as follows:
Second, I use the countax function to count the column columns. The final measure expression is as follows:
Has1value =
VAR _table = SUMMARIZE('Table','Table'[Column1],"a",FIND(1,'Table'[Column1],1,0))
RETURN COUNTAX(FILTER(_table,[a] <>0),'Table'[Column1])
Here are the results:
I've uploaded the PBIX file I used this time below.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I tried your DAX expression, but if there is the same value in multiple rows, only one is considered:
While in input I've 10 rows:
Hi, @Pwrbi_usr
Thank you very much for your reply. Since the summary will ignore the rows that have the same value. I modified this DAX expression:
This way rows with the same value will not be ignored, and the final DAX expression will look like this:
Has1value =
VAR _table = ADDCOLUMNS(CALCULATETABLE('Table'),"a",FIND(1,'Table'[Column1],1,0))
RETURN COUNTAX(FILTER(_table,[a] <>0),'Table'[Column1])
I've uploaded the PBIX file I used this time below.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
17 | |
14 | |
11 | |
9 | |
7 |