Forum Discussion
Anonymous
6 years agoNot applicable
What is wrong with this DAX?
Hi All,
I need to calculate what is the total no. of rows where PI is NOT Blank from the Planning table.
So I wrote the DAX
PI Count = IF(ISBLANK(MAX(Planning[PI])),Blank(),COUNT(Pl])).
But it is giving me total no of rows in that table. It means my "IF" clause is not working.
Just wanted to know what is wrong with this DAX?
In place of MAX what other aggregate function() I can use?
TIA
Anonymous - Try:
PI Count = COUNTROWS(FILTER('Planning',[PI] <> BLANK()))
4 Replies
- Greg_DecklerCommunity Champion
Anonymous - Try:
PI Count = COUNTROWS(FILTER('Planning',[PI] <> BLANK()))- AnonymousNot applicable
- Greg_DecklerCommunity Champion
Anonymous -
PI Count = IF(ISBLANK(MAX(Planning[PI])),Blank(),COUNT(Pl])).
So basically what this says is get the MAX of the column PI and check if it is BLANK. But, this is going across the entire table in context, not row by row (iterator) so it will likely never be blank because you are getting the MAX. Thus, you always get the count of the rows in the table in context. I would suspect that if you used MIN you would end up always getting BLANK since the mininum value in that column is probably BLANK.