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 dateJoin 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.
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 |
---|---|
62 | |
61 | |
55 | |
38 | |
27 |
User | Count |
---|---|
83 | |
61 | |
45 | |
41 | |
39 |