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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

Hi @Anonymous ,

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
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

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

HI @Anonymous ,

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
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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