Forum Discussion
inescastelhano
9 years agoFrequent Visitor
Filter by Max Date or Selected Date
Hello everyone, I am new to power BI and I am trying to do the same we can do in Qlikview. So, what I want is to show the count of employees, but: - if no months are selected, I would like to ...
- Anonymous9 years ago
Hi inescastelhano,
You can try to use below formula if it suitable for your requirement:Result = IF(COUNTROWS('Calendar')<>COUNTROWS(ALL('Calendar')),//check all selected or not select "Distinct Count: "&CALCULATE(DISTINCTCOUNT('Link'[Employee]),VALUES('Calendar'[Date])), "Last Month: "&MONTH(LASTDATE('Calendar'[Date])))Notice: you should ensure these tables contains relationship and the cross filter direction is setting to 'both'.
Regards,
Xiaoxin Sheng
vanessafvg
Community Champion
9 years agoyou might have to use an if statement but maybe lastdate will work for you?
inescastelhano
9 years agoFrequent Visitor
Hi vanessafvg, moreover I get an error saying "A function LASTDATE has been used in a True/False expression that is used as a table filter expression. This is not allowed."
Thank you