Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I made measure _CurrentDataValueMPreviousDateValue
and i try to count rows that _CurrentDataValueMPreviousDateValue is minus
so i tried
Solved! Go to Solution.
Hi @Fighting21
1st create calculated column that computes the difference for each row
CurrentDateValueMPreviousDateValue =
VAR CurrentDate = 'DataTable'[Date]
VAR PreviousDate =
CALCULATE(
MAX('DataTable'[Date]),
FILTER(
ALL('DataTable'),
'DataTable'[Date] < CurrentDate
)
)
VAR CurrentDateValue =
CALCULATE(
SUM('DataTable'[Value]),
'DataTable'[Date] = CurrentDate
)
VAR PreviousDateValue =
CALCULATE(
SUM('DataTable'[Value]),
'DataTable'[Date] = PreviousDate
)
RETURN
CurrentDateValue - PreviousDateValue
Then create a measure to count the rows where the calculated column is less than 0
CountlessthazeroValues =
CALCULATE(
COUNTROWS('DataTable'),
FILTER(
'DataTable',
'DataTable'[CurrentDateValueMPreviousDateValue] < 0
)
)
Let me know if it works
Hi @Fighting21
1st create calculated column that computes the difference for each row
CurrentDateValueMPreviousDateValue =
VAR CurrentDate = 'DataTable'[Date]
VAR PreviousDate =
CALCULATE(
MAX('DataTable'[Date]),
FILTER(
ALL('DataTable'),
'DataTable'[Date] < CurrentDate
)
)
VAR CurrentDateValue =
CALCULATE(
SUM('DataTable'[Value]),
'DataTable'[Date] = CurrentDate
)
VAR PreviousDateValue =
CALCULATE(
SUM('DataTable'[Value]),
'DataTable'[Date] = PreviousDate
)
RETURN
CurrentDateValue - PreviousDateValue
Then create a measure to count the rows where the calculated column is less than 0
CountlessthazeroValues =
CALCULATE(
COUNTROWS('DataTable'),
FILTER(
'DataTable',
'DataTable'[CurrentDateValueMPreviousDateValue] < 0
)
)
Let me know if it works
Hi @Fighting21
Please provide a workable sample data and your expected result from that. It is hard to figure out what you want to achieve from the description alone.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
73 | |
71 | |
54 | |
38 | |
31 |
User | Count |
---|---|
71 | |
64 | |
60 | |
50 | |
45 |