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
TornDigorn
Frequent Visitor

DAX - support - return final number of days

Hello dear PBI community
 
I need help in creating a DAX expression that will allow me to return the value "number of days" in the column "return final number of days" but only in the row where the date appears in the "final date" column,  other rows should be blank. 
 
Expected result below -  (Expected returned value in green)
TornDigorn_0-1686673412894.png

 

1 ACCEPTED SOLUTION

@TornDigorn 

Please remove the Max function that is highlighted below.

NaveenGandhi_0-1686762567009.png

Let me know if this helps and if you have any question.

If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

View solution in original post

6 REPLIES 6
TornDigorn
Frequent Visitor

@NaveenGandhi  Hello Again, 

 

it works, but not as it should 

4 (number of days)  should be returned just next to the final date 

 

Thanks for your patience 😉

TornDigorn_0-1686683233946.png

 

@TornDigorn 

Please remove the Max function that is highlighted below.

NaveenGandhi_0-1686762567009.png

Let me know if this helps and if you have any question.

If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

Hello @NaveenGandhi 

 

Got it ! Thanks a lot ! 🙂

 

TornDigorn_0-1686818430743.png

 

NaveenGandhi
Super User
Super User

Hello @TornDigorn 

Try the below DAX.

Final Days =
VAR Max_date =
CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Name] ) )
RETURN
IF (
'Table'[Date] = Max_date,
CALCULATE (
MAX ( 'Table'[Number of Days] ),
ALLEXCEPT ( 'Table', 'Table'[Name] )
),
BLANK()

)

Let me know if this helps and if you have any question.

If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

Hello NaveenGandhi

 

unfortunately there is a bug

TornDigorn_0-1686676881083.png

 

@TornDigorn 

Just replace the "" with BLANK(), I have made the edit to my orginal DAX as well. It should work now.


I created it as a measure, for a column you need to make this change.


Thanks,

Naveen

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.