Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Convert CALCULATED COLUMN to MEASURE

Hi Team,

 

Newbie here,

 

Is there any way to convert the below CALCULATED COLUMN to MEASURE

 

Capture.PNG

 

This will help me to make the formula dynamically.

 

Thank you so much!

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

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 () )

vluwangmsft_0-1629103927258.png

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:

vluwangmsft_1-1629103971359.png

 

Wish it is helpful for you!

 

Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

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 () )

vluwangmsft_0-1629103927258.png

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:

vluwangmsft_1-1629103971359.png

 

Wish it is helpful for you!

 

Best Regards

Lucien

vanessafvg
Super User
Super User

what are you trying to achieve, can you explain your requirements?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors