cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

IF STAMENT TO MAKE A FLAG ON A TABLE

Capture11111111111.PNGhello can someone help me please

here what i want to do

i wrote a if statement to display in a column 1 or 0

if the date = to max date it should put 1 else 0

= IF('DATE DE DEMANDE'[DATE] = LASTDATE('DATE DE DEMANDE'[DATE]);1;0)

 

but i'm getting 1 on all the column

 

 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: IF STAMENT TO MAKE A FLAG ON A TABLE

=
var __thisDate = 'DATE DE DEMANDE'[DATE]
var __lastDateInTable = MAX( 'DATE DE DEMANDE'[DATE] )
return
	1 * (__thisDate = __lastDateInTable )


Have I answered your question?
Please mark my post as the solution.


Please don't forget your Kudos if you don't mind. Thanks.


View solution in original post

5 REPLIES 5
Highlighted
Super User IV
Super User IV

Re: IF STAMENT TO MAKE A FLAG ON A TABLE

Do you want to mark as 1 the last day in each year? In each month? Or only the very last date in the table? What's the logic?

Best
D


Have I answered your question?
Please mark my post as the solution.


Please don't forget your Kudos if you don't mind. Thanks.


Highlighted
Helper I
Helper I

Re: IF STAMENT TO MAKE A FLAG ON A TABLE

hello
i want to mark the very last date on the table as 1
like as you cas see the last date on the table is 19/02/2020 it should be mark as 1
juste that the table with grow and each time i'm on the max date  it should have 1 and the rest 0

Highlighted
Super User IV
Super User IV

Re: IF STAMENT TO MAKE A FLAG ON A TABLE

=
var __thisDate = 'DATE DE DEMANDE'[DATE]
var __lastDateInTable = MAX( 'DATE DE DEMANDE'[DATE] )
return
	1 * (__thisDate = __lastDateInTable )


Have I answered your question?
Please mark my post as the solution.


Please don't forget your Kudos if you don't mind. Thanks.


View solution in original post

Highlighted
Helper I
Helper I

Re: IF STAMENT TO MAKE A FLAG ON A TABLE

thank you for your help 🙂

Highlighted
Super User IV
Super User IV

Re: IF STAMENT TO MAKE A FLAG ON A TABLE

Thanks for giving Kudos 🙂

Best
D


Have I answered your question?
Please mark my post as the solution.


Please don't forget your Kudos if you don't mind. Thanks.


Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors