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
jagtapsangha
New Member

Need Help with DAX function to populate Date_Time field while choosing parameter

Hi ,

I want to populate a values(Date) in "Date_Time" column, while applying a 'Choose_Type' parameter in the slicer inside the report

Example -
1)If I select "BBB" then it should populate values from "Query_Date" Field in Date_Time Column
and
2)If I select "CCC" then it should populate values from "QC_

Date" Field in Date_Time Column

We are using 'Choose_type' parameter because it is dependent parameter for of data

 

 

Close_DateQuery_DateQC_DateProjectName
9/19/2022  A
9/18/20228/17/2022 B
9/17/2022 8/17/2022C
9/16/2022 8/17/2022D
9/15/20228/17/2022 E
9/14/20228/17/2022 F

 

I have attached the dummy file. Does anyone has solution for above mention scenario.

1 ACCEPTED SOLUTION
v-yadongf-msft
Community Support
Community Support

Hi @jagtapsangha ,

 

Please consider using field parameters.

 

1.Create three measures:

AAA = SELECTEDVALUE('Table'[Close_Date])
BBB = SELECTEDVALUE('Table'[Query_Date])
CCC = SELECTEDVALUE('Table'[QC_Date])

 

2. Using field parameters.

vyadongfmsft_0-1665996967110.png

vyadongfmsft_1-1665997014750.png

 

3.After creating a field parameter, you will get a parameter slicer automatically.

vyadongfmsft_2-1665997068888.png

4.Create a table visual like this:

vyadongfmsft_3-1665997158782.png

 

5. The result you want:

vyadongfmsft_4-1665997398783.png

Best regards,

Yadong Fang

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-yadongf-msft
Community Support
Community Support

Hi @jagtapsangha ,

 

Please consider using field parameters.

 

1.Create three measures:

AAA = SELECTEDVALUE('Table'[Close_Date])
BBB = SELECTEDVALUE('Table'[Query_Date])
CCC = SELECTEDVALUE('Table'[QC_Date])

 

2. Using field parameters.

vyadongfmsft_0-1665996967110.png

vyadongfmsft_1-1665997014750.png

 

3.After creating a field parameter, you will get a parameter slicer automatically.

vyadongfmsft_2-1665997068888.png

4.Create a table visual like this:

vyadongfmsft_3-1665997158782.png

 

5. The result you want:

vyadongfmsft_4-1665997398783.png

Best regards,

Yadong Fang

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

jagtapsangha
New Member

Date_Time.jpg

@jagtapsangha You can't do that as a calculated column because those are not dynamic and are calculated at the time of data refresh/load. You could do it as a measure.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler , 

We want to use this "Date_Time" Column as a filter in Slicer so cant do that with Measure , so is their any other work around or option to solve this?

 

Thanks

@jagtapsangha Potentially unpivot your two date columns?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Many other fileds are depend on My "Choose_Type" parameter , 

by using that filter on parameter we wanted to calculate further  fields 

you can check the snapshot attached 

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.