cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
emmyraldx Frequent Visitor
Frequent Visitor

Can anyone help Convert this calculated column to measure

Hi guys, I have wanting to convert this calculated column to measure: 

 

IF(AND(AND(FctTable[CSDateTime] <> BLANK(), FctTable[CSDateTime] <= FctTable[EndDate]), FctTable[CSDateTime]<TODAY()), 1, IF(FctTable[CSDateTime] >=TODAY(), 2, IF( AND(FctTable[CSDateTime] > FctTable[EndDate], FctTable[CSDateTime] <=TODAY()), 3, IF(FctTable[CSDateTime] = BLANK(), 0))))

 

This is the closest I have but it's still incorrect:

 

IF(AND(AND(LEFT(MAX('FctTable'[CSDateTime]),20) <> BLANK(), LEFT(MAX('FctTable'[CSDateTime]),20) <=LEFT(MAX
('FctTable'[EndDate]),20)), LEFT(MAX('FctTable'[CSDateTime]),20) < LEFT(MAX(TODAY(),20))), 1,
IF(LEFT(MAX('FctTable'[CSDateTime]),20) >= LEFT(MAX(TODAY(),20)), 2,
IF( AND(LEFT(MAX('FctTable'[CSDateTime]),20) > LEFT(MAX('FctTable'[EndDate]),20), LEFT(MAX('FctTable'[CSDateTime]),20) <= LEFT(MAX(TODAY(),20))), 3,
IF(LEFT(MAX('FctTable'[CSDateTime]),20) = BLANK(), 0))))
 
Please help.
 
Emmyraldx
1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-cherch-msft
Microsoft

Re: Can anyone help Convert this calculated column to measure

Hi @emmyraldx 

You may try below measure:

Measure =
IF (
    AND (
        AND (
            MAX ( 'FctTable'[CSDateTime] ) <> BLANK (),
            MAX ( 'FctTable'[CSDateTime] ) <= MAX ( 'FctTable'[EndDate] )
        ),
        MAX ( 'FctTable'[CSDateTime] ) < TODAY ()
    ),
    1,
    IF (
        MAX ( 'FctTable'[CSDateTime] ) >= TODAY (),
        2,
        IF (
            AND (
                MAX ( 'FctTable'[CSDateTime] ) > MAX ( 'FctTable'[EndDate] ),
                MAX ( 'FctTable'[CSDateTime] ) <= TODAY ()
            ),
            3,
            IF ( MAX ( 'FctTable'[CSDateTime] ) = BLANK (), 0 )
        )
    )
)

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Microsoft v-cherch-msft
Microsoft

Re: Can anyone help Convert this calculated column to measure

Hi @emmyraldx 

You may try below measure:

Measure =
IF (
    AND (
        AND (
            MAX ( 'FctTable'[CSDateTime] ) <> BLANK (),
            MAX ( 'FctTable'[CSDateTime] ) <= MAX ( 'FctTable'[EndDate] )
        ),
        MAX ( 'FctTable'[CSDateTime] ) < TODAY ()
    ),
    1,
    IF (
        MAX ( 'FctTable'[CSDateTime] ) >= TODAY (),
        2,
        IF (
            AND (
                MAX ( 'FctTable'[CSDateTime] ) > MAX ( 'FctTable'[EndDate] ),
                MAX ( 'FctTable'[CSDateTime] ) <= TODAY ()
            ),
            3,
            IF ( MAX ( 'FctTable'[CSDateTime] ) = BLANK (), 0 )
        )
    )
)

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

emmyraldx Frequent Visitor
Frequent Visitor

Re: Can anyone help Convert this calculated column to measure

@v-cherch-msft 

Thank you v-cherch. It works. Really appreciate.

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)