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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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

Hi @Anonymous ,

 

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
v-zhenbw-msft
Community Support
Community Support

Hi @Anonymous ,

 

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.

Anonymous
Not applicable

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 @Anonymous ,

 

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.

Anonymous
Not applicable

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

ryan_mayu
Super User
Super User

@Anonymous 

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!




amitchandak
Super User
Super User

@Anonymous , 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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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