cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bvss Member
Member

How to show conditional columns for less than / greater than between two dates

Hi Community People,

 

I have a table with these Columns Start date, End date, FYStart, FYEnd, Name, Price. I created calendar table for start and End date also. Based on Start and End dates i have created calculted column for FYStart and FYEnd

 

I have created Hierarchy slicer for Calendar table. But now i want to create with all the filds with below condition

Show only this data --------- names whose start date <= FYStart && End date >=FYEnd

 

How to write dax, Can you please help me out from this

 

Thank you in advance

 

Thanks & Regards,

B V S Sudhakar

 

4 REPLIES 4
Community Support Team
Community Support Team

Re: How to show conditional columns for less than / greater than between two dates

Hi @bvss ,

You can add following calculated column to your table to check current start date and end date and return tag:

Condition =
IF ( [Start Date] <= [FYStart] && [End Date] >= [FYEnd], "Y", "N" )

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
bvss Member
Member

Re: How to show conditional columns for less than / greater than between two dates

Hi @v-shex-msft ,

 

Thank you for your response, But that's not what i want. Here i am sharing my sample data.

Now the requirement is 

i want create one table with these fields -- Item description, Start, End, Price*8 (But the condition is I want to show only this data ---------

1. whose Item Description is start date <= FYStart && End date >=FYEnd 

2. if i select FY 2018 in my slicer values will show only FY 2018 related 

Ex: Slicer FY 2018

See In Alan Woo Details He worked nearly Full 6 FY years (at this case i want to show him all FY Years what i mean is if i select FY 2017 or FY 2016 then also his details need to show with FY Start and Fy ENd dates)

That means if i select FY 2016

Alan Woo  His start is 01/04/2015 and End is 31/03/2016 Price value is same 78.67

 

Is it possible? Can you please help me out from this

 

Item DescriptionStartEndN PriceValues
+11/19/20181/31/201965
Aakriti Srivastava6/12/2018 43.5
Abhishek Anapally Satayanaraya10/9/2018 110
Abiodun Adebiyi12/3/2018 65
Achal Vishwanathan6/25/2018 57
Adam Etman7/5/2018 80
Adam Etman7/5/20181/4/201980
Adashea Simpson-Womack10/4/20162/6/201922
Adele Dawre5/3/20185/25/201822
Aditya Malhotra2/5/20194/22/201950
Adriel Greaves5/3/20185/16/201822
Adrienne Williams5/29/20189/14/201822
Aishwarya Umachandran12/5/2018 45
Alan Woo1/23/20121/7/201978.67
Alekhya Nyatani4/22/2019 85
Alessandra Alfieri12/11/20186/7/201923

 

 

Thank you in advance

Community Support Team
Community Support Team

Re: How to show conditional columns for less than / greater than between two dates

HI @bvss ,

Unfortunately, current power bi not support to create dynamic calculated column/table based on slicer/filter.

You can consider to write a measure to compare selected date range and current row contents and return tag, then apply it on visual level filter to hide unmatched records.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
bvss Member
Member

Re: How to show conditional columns for less than / greater than between two dates

Hi @v-shex-msft ,

 

Can you please explain little more with example. Because i tried but missing something at some where

 

Thank you in advance

 

Regards,

B V S S

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)