I created a distinct table using Union and Distinct and want to exclude Blank category
As you see in the below chart, the Blank category shows up. I want to exclude this from my distinct table.
Thanks for your help
I created a distinct table using Union and Distinct and want to exclude Blank category
As you see in the below chart, the Blank category shows up. I want to exclude this from my distinct table.
Thanks for your help
Try wrapping the Union equation into a =CALCULATETABLE() function.
Maybe something along the lines of =CALCULATETABLE(Union equation,[Marketing Assets] <> āBlankā).
Have the union as the table being calculated, and then the argument being made is that the marketing assets column cannot equal āBlankā
The filter getting rid of Blanks canāt be the first argument in a CALCULATETABLE function. The first argument has to be a table. if you put the filter in the second position do you get the same error?
I get this error now. It states each table argument of āUnionā must have the same number of columns.
Let me upload a WIP. One second
WIP File.pbix (13.0 MB)
To get it working, itās not ideal, but you can calculate another table by referencing the current one with:
Marketing Assets Calculate = CALCULATETABLE(āMarketing Asset TopNā,FILTER(āMarketing Asset TopNā,āMarketing Asset TopNā[Marketing Assets] <> āBlankā))
Let me play around to try and avoid needing two tables.
It must have been syntax, as I just got this to work in the original table:
Marketing Asset TopN =
CALCULATETABLE(UNION(
DISTINCT(āMarketing Assetsā[Marketing Assets]),
DATATABLE(āMarketing Assetsā,STRING,{{āOthersā}})),FILTER(āMarketing Assetsā,āMarketing Assetsā[Marketing Assets] <> āBlankā)
)
Thanks Zherkezhi. It works fine.
Much appreciated.
Can you send over the WIP file?
Thanks