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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jen8080
Helper I
Helper I

Creating new column and a calculated column

Hello-
I need to be able to pull the 'Live' Milestone Actual date into a column for each ID.
I then need to be able to pull the 'In Date' Milestone Actual date into a column for each ID.

Then I need to compare the dates, if the 'Live' Actual data is blank, it would be 'N/A', if the 'In Date' was blank it would be "Yes" and if the 'Live'<'In Date', "Yes", "No"

I made this in a matrix but need it in column because I can't get the measures to populate any charts.
Any help is appreciated!
Here is a sample the data

jen8080_0-1601665388638.png

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@jen8080, try these calculated columns:

 

Live Actual Date = 
VAR vID = Milestone[ID]
VAR vTargetRow =
    FILTER ( Milestone, Milestone[ID] = vID && Milestone[Milestone Name] = "Live" )
VAR vResult =
    MAXX ( vTargetRow, Milestone[Actual Date] )
RETURN
    vResult


In Date Actual Date = 
VAR vID = Milestone[ID]
VAR vTargetRow =
    FILTER ( Milestone, Milestone[ID] = vID && Milestone[Milestone Name] = "In Date" )
VAR vResult =
    MAXX ( vTargetRow, Milestone[Actual Date] )
RETURN
    vResult


Calc Column = 
VAR vLiveActualDate =
    Milestone[Live Actual Date]
VAR vInDateActualDate =
    Milestone[In Date Actual Date]
VAR vResult =
    SWITCH (
        TRUE (),
        ISBLANK ( vLiveActualDate ), "N/A",
        ISBLANK ( vInDateActualDate ), "Yes",
        vLiveActualDate < vInDateActualDate, "Yes",
        "No"
    )
RETURN
    vResult

 

DataInsights_0-1601677101638.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @jen8080,

Did DataInsights 's suggestion help for your scenarioIf this is a case, you can consider accepting this suggestion to help other users with the same requirement.
If not, you can feel free to post here with detailed information and descriptions.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
DataInsights
Super User
Super User

@jen8080, try these calculated columns:

 

Live Actual Date = 
VAR vID = Milestone[ID]
VAR vTargetRow =
    FILTER ( Milestone, Milestone[ID] = vID && Milestone[Milestone Name] = "Live" )
VAR vResult =
    MAXX ( vTargetRow, Milestone[Actual Date] )
RETURN
    vResult


In Date Actual Date = 
VAR vID = Milestone[ID]
VAR vTargetRow =
    FILTER ( Milestone, Milestone[ID] = vID && Milestone[Milestone Name] = "In Date" )
VAR vResult =
    MAXX ( vTargetRow, Milestone[Actual Date] )
RETURN
    vResult


Calc Column = 
VAR vLiveActualDate =
    Milestone[Live Actual Date]
VAR vInDateActualDate =
    Milestone[In Date Actual Date]
VAR vResult =
    SWITCH (
        TRUE (),
        ISBLANK ( vLiveActualDate ), "N/A",
        ISBLANK ( vInDateActualDate ), "Yes",
        vLiveActualDate < vInDateActualDate, "Yes",
        "No"
    )
RETURN
    vResult

 

DataInsights_0-1601677101638.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




mhossain
Solution Sage
Solution Sage

@jen8080 

Not clear to me, do you need one row for one ID? Do you want to transform the sample data you provided, in the PowerBI how your table looks like?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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