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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
anonymous23
Regular Visitor

Return blank value if earliest date and actual date value if later

Hello! I am working with monthly portfolios of accounts and looking to track additions to the population based on the earliest report an account appears in. However, if an account appears in the first report in our database, I do not want a value to be returned (either 0, blank, or null is sufficient).

I have created a measure to calculate the Earliest Date with the following formula: 

Earliest Date = FIRSTDATE('Additions/Disposals'[First Month)
 
I've tried to use the following formula to return the earliest month, exluding the first month of the data for each of the accounts and receive only the value 0 or an error message:
Addition = IF([First Month]=[Earliest Date],0,[First Month])

 

Here is my data set:

anonymous23_0-1652974289732.png

 

and my intended result in the Addition column would return as follows in order, so that I am able to count the number of additions in a period:

0

0

0

2/1/2022

2/1/2022

0

0

3/1/2022


Thank you for any assistance!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @anonymous23 ,

Please have a try. 

Create a measure.

Earliest Date =
VAR _mindate =
    MINX ( ALL ( 'Table' ), 'Table'[first month] )
RETURN
    IF (
        MAX ( 'Table'[first month] ) = _mindate,
        BLANK (),
        MAX ( 'Table'[first month] )
    )

vpollymsft_1-1653360110868.png

 

 

Best Regards

Community Support Team _ Polly

 

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
Anonymous
Not applicable

Hi @anonymous23 ,

Please have a try. 

Create a measure.

Earliest Date =
VAR _mindate =
    MINX ( ALL ( 'Table' ), 'Table'[first month] )
RETURN
    IF (
        MAX ( 'Table'[first month] ) = _mindate,
        BLANK (),
        MAX ( 'Table'[first month] )
    )

vpollymsft_1-1653360110868.png

 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sturlaws
Resident Rockstar
Resident Rockstar

Hi, @anonymous23,

 

could you try to write your calculated column like this:

addition =
VAR _firstMonth =
    CALCULATE ( MIN ( 'Table'[first month] ), ALL ( 'Table' ) )
RETURN
    IF ( 'Table'[first month] = _firstMonth, BLANK (), 'Table'[first month] )

 

Cheers,
Sturla


If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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