Forum Discussion
Rth
3 years agoNew Member
Count with condition
Hi everyone, would anyone be able to help with a DAX calculation for the following? I have a table including Name of the Project (projects are recurring) and Amount of Hours as columns. Now I wo...
- 3 years ago
Hi Rth ,
You could try below code:-
m = VAR _calc = FILTER ( SUMMARIZE ( 'Table (5)', 'Table (5)'[Name of Project], "_SUM", SUM ( 'Table (5)'[Column1] ) ), [_SUM] >= 20 ) RETURN COUNTROWS ( _calc )
Rth
3 years agoNew Member
Hi,
thanks for your response.
I think I did not express myself well enough. I attachted an example:
The table's name is "Table".
Regarding your code:
I used DISTINCTCOUNT instead of COUNTROWS because I would like to count the distinct number of projects. But the code still did not work..
FreemanZ
3 years agoSuper User
Aha, then try this
Project20Plus =
CALCULATE(
COUNTROWS( DISTINCT(CATS_Buchungen[Project])
),
FILTER(
ALL(CATS_Buchungen),
CATS_Buchungen[HoursColumn]>20
)
)