March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Register NowGet certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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! Early Bird pricing ends December 9th.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
116 | |
83 | |
77 | |
66 | |
57 |
User | Count |
---|---|
130 | |
111 | |
97 | |
78 | |
75 |