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 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.
User | Count |
---|---|
73 | |
69 | |
35 | |
27 | |
26 |
User | Count |
---|---|
96 | |
92 | |
54 | |
45 | |
41 |