0
votes

I'm new in DAX. I have dimension Tasks. I have fact table FactEntries. In fact table we can have for example multiple rows per one task. How could I create measure that will count distinct tasks in table FactEntries, but only those tasks which are completed (column [Task Is Complited][bit] - values 1 or 0; from table Tasks). Could you help me? Thanks!

2

2 Answers

0
votes

I found a solution:

Tasks Completed:= CALCULATE(DISTINCTCOUNT('Entries'[Task Key]),CALCULATETABLE(Task, Task[Task Is Completed]<>False()))
0
votes

You can distinctcount the nameof the task instead by key task, and instead of calculatetable you can use a simple filter Tasks Completed:= CALCULATE(DISTINCTCOUNT('Entries'[Task name]),filter(Task, Task[Task Is Completed]<>False()))