Forum Discussion
Removing Nulls from Only One Parameter Field
- 2 years ago
Hi Anonymous
To achieve a goal you can take these few steps :1 With power query replace "blanks " with null (until you do it the engine of pbi does not recognize these cells as blanks.
2. After creating field parameters add to the parameters table another column with the parameter name to have an ability to create conditions with it
3 . Create a flag measure that will check which parameter was selected and if it is blank:
test_intern = if(SELECTEDVALUE('Parameter'[Test parametr])="Intern" && ISBLANK(max('Table'[Intern])),1,0)4. Use this measure to filter the visual
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Ritaf1983 Here is an example of the table named "Assignment."
| Assignment | Product Engineer | Product Developer | Intern | Total Produced | Total Sold |
| 232451 | Mannie Jacobson | Carlie Abrams | 341 | 238 | |
| 232452 | Jerrie Vinland | Jose Martinez | 121 | 99 | |
| 232453 | Connie Bandit | Mickie Barrett | Mariah Ham | 645 | 561 |
| 232454 | Mannie Jacobson | Jose Martinez | 222 | 106 | |
| 232455 | Connie Bandit | Carlie Abrams | 99 | 88 | |
| 232456 | Mannie Jacobson | Carlie Abrams | Mariah Ham | 561 | 498 |
Here is what the Field Parameter looks like, a standard field parameter based off of fields in the assignment table.
| Production Role | Parameter Fields | Parameter Order |
| Product Engineer | 'Assignment'[Product Engineer] | 0 |
| Product Developer | 'Assignment'[Product Developer] | 1 |
| Intern | 'Assignment'[Intern] | 2 |
Now, this is what the tables look like on the front end, imagining that each table pops up when you click on the role tile based on the parameter, and the first row in the table is the role type.
| Product Engineer | Total Produced | Total Sold |
| Mannie Jacobson | 1124 | 842 |
| Connie Bandit | 744 | 649 |
| Jerrie Vinland | 121 | 99 |
| TOTAL | 1989 | 1590 |
| Product Developer | Total Produced | Total Sold |
| Carlie Abrams | 1001 | 824 |
| Jose Martinez | 343 | 205 |
| Mickie Barrett | 645 | 561 |
| TOTAL | 1989 | 1590 |
| Intern | Total Produced | Total Sold |
| 783 | 531 | |
| Mariah Ham | 1206 | 1059 |
| TOTAL | 1989 | 1590 |
So here you can see that nulls are pulling in for Interns, even though I only want the TRUE intern totals. The other two charts are perfectly fine as there are no nulls and nothing is skewing the data, so we want to make sure the assignments that have interns that are null are still pulling product developers and engineers so that their totals are correct. But imagine if there were many many more rows and more interns, they could see their personal totals, but managers would not be able to see the production of interns as a whole. So I want to be able to have this parameter set up where you can click on a slicer role tile and switch between the three roles to see the three charts I have put aboce, but only have to make the one chart thanks to parameters. But I want to take out null role names so that the totals are correct.
Hi Anonymous
To achieve a goal you can take these few steps :
1 With power query replace "blanks " with null (until you do it the engine of pbi does not recognize these cells as blanks.
2. After creating field parameters add to the parameters table another column with the parameter name to have an ability to create conditions with it
3 . Create a flag measure that will check which parameter was selected and if it is blank:
4. Use this measure to filter the visual
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly