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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jfmejiav1
Frequent Visitor

create a conditional flag

Hello,

 

Currently y have a table with snapshot of deals the date of the snapshot and if in that date the deal had a flag or not. ( see below)

 

Annotation 2019-04-23 105708.png

 

I want to create a column that puts the first date when the deal had a flag. So for example deal h first had the flag on the 22, then i only want a date on a new column for the 22th of April not for the 22 and 29.

 

how can i do this?

 

thank you 

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @jfmejiav1,

Try this for your new calculated column, where Table1 is the table you show:

NewCol =
CALCULATE (
    MIN ( Table1[SnapDate] ),
    Table1[Flag] = 1,
    ALLEXCEPT ( Table1, Table1[Deal iD] )
)

or this (I'm not quite sure which one you need):

NewCol =
VAR _Date =
    CALCULATE (
        MIN ( Table1[SnapDate] ),
        Table1[Flag] = 1,
        ALLEXCEPT ( Table1, Table1[Deal iD] )
    )
RETURN
    IF ( Table1[SnapDate] = _Date, _Date )

 

View solution in original post

1 REPLY 1
AlB
Super User
Super User

Hi @jfmejiav1,

Try this for your new calculated column, where Table1 is the table you show:

NewCol =
CALCULATE (
    MIN ( Table1[SnapDate] ),
    Table1[Flag] = 1,
    ALLEXCEPT ( Table1, Table1[Deal iD] )
)

or this (I'm not quite sure which one you need):

NewCol =
VAR _Date =
    CALCULATE (
        MIN ( Table1[SnapDate] ),
        Table1[Flag] = 1,
        ALLEXCEPT ( Table1, Table1[Deal iD] )
    )
RETURN
    IF ( Table1[SnapDate] = _Date, _Date )

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.