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
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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

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.