In powerBi, a column is created with below formula, and it is working good.

activedays = COUNTAX(RELATEDTABLE(ActivesInactiveData),ActivesInactiveData[Surface Date])

However, I want to add a filter some thing like

ActivesInactiveData[Topic]<> null

Could you please advice on how to do so, most of the examples on web are using on relatedtable etc - where relation is already build, could you please advice/direct to me what I could find an example of adding filter to relatedtable or filter data from a unrelated table based on field like ID column etc.

Here there is a relation user ID in current table has more than 1 rows in ActivesInactiveData table.


1 Answer 1


I would wrap your expression in a CALCULATE function, so something like:

activedays = CALCULATE ( 
    COUNTAX ( RELATEDTABLE ( ActivesInactiveData ) , ActivesInactiveData[Surface Date] ) 
    , ISBLANK ( ActivesInactiveData[Topic] ) = FALSE )

I assumed [Topic] is text, so NULL will converted by DAX to BLANK().

  • $\begingroup$ Do have access for the movement - will check once I get the access 2-3 days. Thank you for the help. $\endgroup$
    – surpavan
    Sep 17, 2016 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.