Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I'm sorry if this is a rather obvious question, but I am trying to learn how to add cell content programmatically. The particular goal I'm trying to achieve is to look through a table and add content to a cell if it fulfills certain criteria. In my example, I have a list of companies and contacts who are attending an event. Some companies have no staff members attending the event at all, but other companies have at least one staff member who is attending the event.
I'd like to be able to see all the companies who have no staff members attending at all and not also include staff members who are from a company where someone else is attending. To do this, I'd need to look through the table and find every contact who is attending and for each staff member that is attending, find their company and mark all contacts from that company as attending. Alternatively, for each staff member that is attending, remove all instances of their company within the table. This is a fairly simple programming task, but I'm new to Power Bi and thought I would ask if there was an easy solution to this that I'm missing.
I've posted a screenshot of some arbitrary data which shows some people attending and others in the same company not attending. I'd like to apply the 'YES' to all those who are at the same company. The end goal would be to then have a clean list of companies who have no staff members attending at all.
I'd appreciate any ideas! Thanks.
Hello,
You should be able to do this with PowerQuery.
This will leave you with a table containing the company names that have an employee attending and you can then merge this table back with the original on the company name column.
Depending on the join type selected you could get back only those companies that are not on the list of companies that have an employee attending (Using one of the ANTI join types)
Here is a DAX solution which will give you a list of Companies who had no one attending at all
Table 2 = VAR T1 = SELECTCOLUMNS(FILTER('Sheet1','Sheet1'[Attending]="YES"),"Company Name",[Company Name]) VAR T2 = SUMMARIZE('Sheet1',Sheet1[Company Name]) RETURN EXCEPT(T2,T1)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |