Evan Welty
Evan Welty

Reputation: 1

How can I have DAX return the entirety of a table given a specific condition, while keeping the filters on the page

I am making a dashboard of HR data and I want to make sure that it does not show anything if the total number is below 10 in order to protect PII. This is the page I need to make sure is filtered:

enter image description here Currently it is possible for the numbers of new-hires, and/or separated employees to be below 10 given the right configuration of the filters.

And so I want to make sure that if the resulting total sum for either new-hires or separation given those filters is less than 10 it simply displays "Data Withheld" and the corresponding graph(s) will show nothing. And if it is more than 10 it shows everything as it is currently constructed.

The only way I can think to do this is to create a new table using DAX. However, an IF statement can't return a table as it creates a scalar error.

I tried this:

New_hire_Param = IF(SUM('New-Hires'[COUNT]) < 10, "Data Withheld", SUMMARIZE('New-Hires', 'New-Hires'[OFFICE_NAME], 'New-Hires'[COUNT]))

And obviously got an error. I am not sure what I need to do...I checked this thread: DAX How to return a table based on a condition - workaround for IF to return a table but I genuinely do not understand how I could duplicate that in my own report.

Upvotes: 0

Views: 25

Answers (0)

Related Questions