Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a need to identify IDs in my data who have gone forwards on scoring if interviewed more than once. Set of IDs are evaluated for a Brand and based on responses a scoring value is assigned.
There could be a scenario where some IDs have scored more than what they had scored previously, i.e. I scored 2 in Apr'23 and Aug I scored 3.
All this (DAX Measure) must be responsive to date slicer, so the counting should happen only within the selected date range.
So, to summarize, the requirement is:
1. Identify Ids using a measure that have scored better than what they scored previously (have upgraded). One such case highlighted in the image, should only calculate for cases where an ID has been evaluated more than once
Any suggestion/leads will be greatly appreciated.
Solved! Go to Solution.
try like:
Measure =
VAR _table =
ADDCOLUMNS(
VALUES(data[brand]),
"LastDateScore",
VAR _lastdate = CALCULATE(MAX(data[date]))
RETURN
CALCULATE(
MAX(data[score]),
data[date] = _lastdate
),
"2ndLastDateScore",
VAR _lastdate = CALCULATE(MAX(data[date]))
VAR _2ndlastdate =
CALCULATE(
MAX(data[date]),
data[date] < _lastdate
)
RETURN
CALCULATE(
MAX(data[score]),
data[date] = _2ndlastdate
)
)
RETURN
COUNTROWS(
FILTER(
_table,
[LastDateScore]>[2ndLastDateScore]
&&[2ndLastDateScore]<>BLANK()
)
)
Changed it to CountX, works alright.
Stupendous work mate, many thanks
hi @AlwaysAGooner ,
Not sure if i fully get you, try to plot a measure like:
Measure =
VAR _table =
ADDCOLUMNS(
VALUES(data[brand]),
"LastDateScore",
VAR _lastdate = CALCULATE(MAX(data[date]))
RETURN
CALCULATE(
MAX(data[score]),
data[date] = _lastdate
),
"2ndLastDateScore",
VAR _lastdate = CALCULATE(MAX(data[date]))
VAR _2ndlastdate =
CALCULATE(
MAX(data[date]),
data[date] < _lastdate
)
RETURN
CALCULATE(
MAX(data[score]),
data[date] = _2ndlastdate
)
)
VAR _list =
CALCULATETABLE(
VALUES(data[brand]),
FILTER(
_table,
[LastDateScore]>[2ndLastDateScore]
&&[2ndLastDateScore]<>BLANK()
)
)
RETURN CONCATENATEX(_list, data[brand], ", ")
it worked like:
Thanks. I just need the count not the actuals. So while looking at Brand A for Q1 2023, how many picked on their previous scores.
Pls suggest.
try like:
Measure =
VAR _table =
ADDCOLUMNS(
VALUES(data[brand]),
"LastDateScore",
VAR _lastdate = CALCULATE(MAX(data[date]))
RETURN
CALCULATE(
MAX(data[score]),
data[date] = _lastdate
),
"2ndLastDateScore",
VAR _lastdate = CALCULATE(MAX(data[date]))
VAR _2ndlastdate =
CALCULATE(
MAX(data[date]),
data[date] < _lastdate
)
RETURN
CALCULATE(
MAX(data[score]),
data[date] = _2ndlastdate
)
)
RETURN
COUNTROWS(
FILTER(
_table,
[LastDateScore]>[2ndLastDateScore]
&&[2ndLastDateScore]<>BLANK()
)
)
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 |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |