Forum Discussion
COUNTIFS in Power BI
- 8 years ago
Hi Dan27,
Based on this sample data, is 3 the desired result? If so, please new a measure and add it to card visual.
Measure1 = CALCULATE(COUNTROWS(Table2),FILTER(Table2,Table2[G]<=Table2[H]))
For more advice, please illustrate your requirement with actual sample data and desired result rather than just the Excel functions.
Regards,
Yuliana Gu
COUNTIFS in Excel are generally replaced by using CALCULATE.
Thanks Greg but in what format?
If I use FieldName = CALCULATE([Field1] <= [Field2], " ") for example then I get a message saying the maximum argument count is 2.
Appreciated. Thanks.
- Anonymous8 years agoNot applicable
Hereis the example.
CALCULATE ( COUNT(Table1[Column1]), FILTER ( Table1, Table1[column1] < Table1[Clumn2]))
Thanks
Raj- Dan278 years agoRegular Visitor
Thanks Raj
What you've put is really helpful but it still won't work.
I 'm trying to work out where if Field or column 'G' is less than or equal to column 'H' then return the values of column 'AL' else return a " " blank.
I've tried a few variations of what you suggested but none work. Where above I've referenced column letters I have replaced these with (Table[field]) accordingly.
Thanks
Dan
- Anonymous8 years agoNot applicable
:)
That was the example of CALCULATE.
Here is teh syntax for your Question:
Calculated_Column=IF(Table1[ColumnG] <= Table1[ColumnH] , Table1[ColumnAL], BLANK()
If you want count.
Cnt_Measure = COUNT(Table1[Calculated_Column])
Thanks
Raj