Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
+ I edited question
I made measure _CurrentDataValueMPreviousDateValue
and i try to count rows that _CurrentDataValueMPreviousDateValue is minus
so i tried
Solved! Go to Solution.
Hi @Fighting21
You raw data don't have negative and after summarization, measure have negative. So, I think you need to summarize first and then compare with measure and count rows.
You can try the below code, if it is meets your goal:
CountNegetive =
VAR SummarizedTable =
SUMMARIZE(
'DataTable',
'DataTable'[Category],
'DataTable'[SubCategory],
'DataTable'[Date],
"TotalValue", SUM('DataTable'[Value])
)
VAR CountNegativeRows =
SUMX(
SummarizedTable,
IF(
[_CurrentDateValueMPreviousDateValue] < 0,
1,
0
)
)
RETURN
CountNegativeRows
I found this result, though I don't know it is the desired result what you want to achieve or not:
Hope this helps!!
If this solved your problem, please accept it as a solution and a kudos!!
Best Regards,
Shahariar Hafiz
Hi @Fighting21
You raw data don't have negative and after summarization, measure have negative. So, I think you need to summarize first and then compare with measure and count rows.
You can try the below code, if it is meets your goal:
CountNegetive =
VAR SummarizedTable =
SUMMARIZE(
'DataTable',
'DataTable'[Category],
'DataTable'[SubCategory],
'DataTable'[Date],
"TotalValue", SUM('DataTable'[Value])
)
VAR CountNegativeRows =
SUMX(
SummarizedTable,
IF(
[_CurrentDateValueMPreviousDateValue] < 0,
1,
0
)
)
RETURN
CountNegativeRows
I found this result, though I don't know it is the desired result what you want to achieve or not:
Hope this helps!!
If this solved your problem, please accept it as a solution and a kudos!!
Best Regards,
Shahariar Hafiz
Hi,
Please try something like below if it works.
expected result measure: =
VAR _t =
FILTER ( DataTable, [_CurrentDataValueMPreviousDateValue] < 0 )
RETURN
COUNTROWS ( _t )
Sorry, i changed my question.
You could write this
Countrows(filter(DataTable,Datatable[value]<0))
Sorry, i changed my question.