Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Team,
Newbie here,
Is there any way to convert the below CALCULATED COLUMN to MEASURE
This will help me to make the formula dynamically.
Thank you so much!
Solved! Go to Solution.
Hi @Anonymous ,
The column dax you used:
AVGACC1 =
VAR _1 =
MINX (
FILTER (
'ERI RAW',
'ERI RAW'[Account] = EARLIER ( 'ERI RAW'[Account] )
&& 'ERI RAW'[Attribute] = EARLIER ( 'ERI RAW'[Attribute] )
),
'ERI RAW'[Index]
)
VAR _2 =
MINX (
FILTER (
'ERI RAW',
'ERI RAW'[Account] = EARLIER ( 'ERI RAW'[Account] )
&& 'ERI RAW'[Attribute] = EARLIER ( 'ERI RAW'[Attribute] )
),
'ERI RAW'[Seconds]
)
RETURN
IF ( 'ERI RAW'[Index] = _1, _2, BLANK () )
Then turn to the below measure:
AVGACC2 =
VAR _1 =
CALCULATE(MIN('ERI RAW'[Index]),
FILTER (
ALL('ERI RAW'),
'ERI RAW'[Account] =MAX ( 'ERI RAW'[Account] )
&& 'ERI RAW'[Attribute] = MAX( 'ERI RAW'[Attribute] )
)
)VAR _2 =
CALCULATE(MIN('ERI RAW'[Seconds]),
FILTER (
ALL('ERI RAW'),
'ERI RAW'[Account] =MAX ( 'ERI RAW'[Account] )
&& 'ERI RAW'[Attribute] = MAX( 'ERI RAW'[Attribute] )
)
)
RETURN
IF(MAX('ERI RAW'[Index])=_1,_2,BLANK())
Compare result:
Wish it is helpful for you!
Best Regards
Lucien
Hi @Anonymous ,
The column dax you used:
AVGACC1 =
VAR _1 =
MINX (
FILTER (
'ERI RAW',
'ERI RAW'[Account] = EARLIER ( 'ERI RAW'[Account] )
&& 'ERI RAW'[Attribute] = EARLIER ( 'ERI RAW'[Attribute] )
),
'ERI RAW'[Index]
)
VAR _2 =
MINX (
FILTER (
'ERI RAW',
'ERI RAW'[Account] = EARLIER ( 'ERI RAW'[Account] )
&& 'ERI RAW'[Attribute] = EARLIER ( 'ERI RAW'[Attribute] )
),
'ERI RAW'[Seconds]
)
RETURN
IF ( 'ERI RAW'[Index] = _1, _2, BLANK () )
Then turn to the below measure:
AVGACC2 =
VAR _1 =
CALCULATE(MIN('ERI RAW'[Index]),
FILTER (
ALL('ERI RAW'),
'ERI RAW'[Account] =MAX ( 'ERI RAW'[Account] )
&& 'ERI RAW'[Attribute] = MAX( 'ERI RAW'[Attribute] )
)
)VAR _2 =
CALCULATE(MIN('ERI RAW'[Seconds]),
FILTER (
ALL('ERI RAW'),
'ERI RAW'[Account] =MAX ( 'ERI RAW'[Account] )
&& 'ERI RAW'[Attribute] = MAX( 'ERI RAW'[Attribute] )
)
)
RETURN
IF(MAX('ERI RAW'[Index])=_1,_2,BLANK())
Compare result:
Wish it is helpful for you!
Best Regards
Lucien
what are you trying to achieve, can you explain your requirements?
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 120 | |
| 95 | |
| 70 | |
| 69 | |
| 65 |