Count rows depending on a condition - Power BI
community.powerbi.com › t5 › DesktopOct 5, 2017 · My DAX expression is : RestantaFaire = COUNTROWS (FILTER (HistoriqueInter;HistoriqueInter [FinréelleDateH]. [Année]=1900)) Which doesn't work! However, if I create a new table= Restant = FILTER (HistoriqueInter;HistoriqueInter [FinréelleDateH]. [Année]=1900) And then I create a new measure: RestantaFaire= COUNTROWS (Restant) Then it works!
COUNTROWS function (DAX) - DAX | Microsoft Learn
learn.microsoft.com › en-us › daxJun 21, 2022 · Syntax DAX COUNTROWS( [<table>]) Parameters Return value A whole number. Remarks This function can be used to count the number of rows in a base table, but more often is used to count the number of rows that result from filtering a table, or applying context to a table. Whenever there are no rows to aggregate, the function returns a blank.
COUNTX function (DAX) - DAX | Microsoft Learn
learn.microsoft.com › en-us › daxJun 21, 2022 · If the function finds no rows to count, it returns a blank. If you want to count logical values, use the COUNTAX function. This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules. Example 1. The following formula returns a count of all rows in the Product table that have a list price.