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
Hello all
I am trying to write some DAX (or something?) to help me count and display the number of organisations which do not have any activity recorded for a certain project (e.g. project 1, project 2, project 3 etc).
To provide more context - I have datasets I've imported to PowerBI desktop which I want to analyse, interrogate etc. from three online SharePoint lists:
When I imported the data from a SharePoint list, I had to expant the activity list because a number of the fields have multiple entries. Therefore, ID 1 may appear multiple times.
Each time I record an activity, there may be multiple organisations involved in a given activity and I also mark which project(s) that activity covered.
The issue I'm having is that I can't use filters to show me all the organisations that don't have any activity recorded for a given project (let's say project 1). Because that organisation may have activity recorded for project 1 on another row, so when I filter out all the lines for project 1, the organisation name still remains in there, because there was another entry which had project 2 / project 3 recorded against it. I've done screen shots below to illustrate
Raw data: As you can see the only organisations which don't have any entries for project 1 are Sainsbury's, Costco and McDonalds (so a count of 3)
This shows how the rows were expanded in the activity list
This shows the impact of when I use filters or DAX with the filter function - it returns WH Smith and Pizza Hut because I've filtered out the entries for project 1, but of course they did have entries for project 1.
Can anyone help me work out how to count the number and display the names of the organisations that don't have any entries for project 1?
Solved! Go to Solution.
Hi @marchn ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) Click "transform data" to enter the power query and select [Organisation] to split. You can check the steps in the steps bar on the right.
(3)We can create a table and measures.
Slicer = VALUES('Table'[Project or Workstream])Flag = var _a = SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[Project or Workstream]=SELECTEDVALUE('Slicer'[Project or Workstream])),"organisation",[Organisation])
return IF(MAX('Table'[Organisation]) in _a,0,1)Count = SUMX(SUMMARIZE('Table','Table'[Activity ID],'Table'[Organisation],'Table'[Project or Workstream],"flag",[Flag]),[flag])
(4) Place [Flag]=1 on the visual filter and then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @marchn ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) Click "transform data" to enter the power query and select [Organisation] to split. You can check the steps in the steps bar on the right.
(3)We can create a table and measures.
Slicer = VALUES('Table'[Project or Workstream])Flag = var _a = SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[Project or Workstream]=SELECTEDVALUE('Slicer'[Project or Workstream])),"organisation",[Organisation])
return IF(MAX('Table'[Organisation]) in _a,0,1)Count = SUMX(SUMMARIZE('Table','Table'[Activity ID],'Table'[Organisation],'Table'[Project or Workstream],"flag",[Flag]),[flag])
(4) Place [Flag]=1 on the visual filter and then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
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 |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 12 | |
| 9 | |
| 5 | |
| 5 |