March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |