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

Calculated column using IF function to display a message

Hi,

I need to create a calculated column to show if below statement is true it should write "Created" else "not created".The condition is

Account[Createdon]>=MIN(DateTable[Date]) &&
Account[Createdon]<=MAX(DateTable[Date])
 
Can anyone help me with this?
 
Thanks,
Mishelle
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Mishelle ,

 

Sorry for that Power BI doesn’t support to tick or untick a measure in filter pane. The real column has the basic filtering.

 

cal1.jpg

 

if you want to tick or untick the field, you need to change the measure to column.

But the column will not dynamically change according to the slicer like the measure.

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data or describe the fields of each tables and the relations between tables simply?

It will be helpful if you can show us the exact expected result based on the tables.

 

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

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

6 REPLIES 6
Super User IV
Super User IV

@Mishelle , all the dates will be there on date table so it will always be created. If that is new column in Account table.

 

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Super User II
Super User II

@Mishelle 

please try this

Column = if(Account[createdon]>=min('DateTable'[date])&&Account[createdon]<=max('DateTable'[date]),"Created","Not Created")

 





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

Proud to be a Super User!




Community Support
Community Support

Hi @Mishelle ,

 

If you just want to create a status column that contains “Created” and “Not Created”, @ryan_mayu 's answer is good.

If you want to create a slicer based on Date table to control the status, we suggest to create a measure like this,

 

Measure = 
var _min = MIN(DateTable[Date])
var _max = MAX(DateTable[Date])
return
IF(
    MAX(Account[Createdon])>=_min && MAX(Account[Createdon])<=_max,"Created","Not Created")

 

cal1.jpg

 

cal2.jpg

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data or describe the fields of each tables and the relations between tables simply?

 

It will be helpful if you can show us the exact expected result based on the tables.

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

Hi @v-zhenbw-msft 

Thanks for the explanations and based on your measure i created a similar measure and i need to use this measure in the filter pane as a filter.So user should be able to tick this measure if they need and untick.My measure is 

Measure 2 =
VAR minDate = CALCULATE(MIN(DateTable[Date]))
VAR maxDate = CALCULATE(MAX(DateTable[Date]))
RETURN IF(MAX(DateTable[Date])>=minDate && MAX(DateTable[Date])<= maxDate,
minDate&", "&maxDate)
But i cannot make this as a filter in the filter pane.Is this possible to do?
 
Thanks
Mishelle

Hi @Mishelle ,

 

Sorry for that Power BI doesn’t support to tick or untick a measure in filter pane. The real column has the basic filtering.

 

cal1.jpg

 

if you want to tick or untick the field, you need to change the measure to column.

But the column will not dynamically change according to the slicer like the measure.

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data or describe the fields of each tables and the relations between tables simply?

It will be helpful if you can show us the exact expected result based on the tables.

 

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

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

Hi @v-zhenbw-msft 

Thank you.Thats what i understood.Thanks for the explanations.I have to put date filter to the filter pane and let the user to choose the date he wants 🙂

 

Thanks for the replies 

Mishelle

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors