Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
+ 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.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
18 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |