Forum Discussion
DimaMD
4 years agoSolution Sage
Count unique rows plan
Hello community! I have a task, need your help to solve it. We have two tables, one of them - date and month; second - customer and product ID's, number of line. Based on one month (february) ...
- 4 years ago
Hi,
Please check the below picture and the measure.
fix measure = VAR conditiontable = FILTER ( Plan, Plan[Contract] IN { "Own production", "Trading" } ) VAR nonconditiontable = SUMMARIZE ( EXCEPT ( Plan, conditiontable ), Plan[Contract] ) RETURN COUNTROWS ( conditiontable ) + COUNTROWS ( nonconditiontable )
PiEye
4 years agoResolver II
In this example, you can use an IF() statement to check whether the column has the value you wish, and then returns a different count depending on it.
"IN()" checks the value against a list of values.
EG
IF(SELECTEDVALUE(Table[Contract]) IN {"Production","Trading"}
,
,
DISTINCTCOUNT(Table[product ID]),
count(Table[product ID]))
Does this work for you?
Pi