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

combine 2 columns as 1 slicer in Power BI Or add 2 columns to slicer value. (multiple value)

Hi,
I have problem about how to combine 2 columns as 1 slicer in Power BI. Or add 2 columns to slicer value. (multiple value).
So, let me explain first. I have 2 columns, StartDate and EndDate with the Data Type is Date. And I need only 1 slicer to choose both the Start and End Date (if I choose between layout on the slicer, I can fill the first field for StartDate and the second one to EndDate). Can anybody tell me how to create that slicer ?
Or maybe what I need to do first with these columns before I adding it to the slicer. Thank you

Maybe help to understand more, here's the picture

IMG_20190909_094456.JPG

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

Hi @Anonymous ,

 

You can make these two columns to one column with a new table.

Table 2 =
UNION (
    SELECTCOLUMNS ( 'Table', "Date", 'Table'[start] ),
    SELECTCOLUMNS ( 'Table', "Date", 'Table'[end] )
)

The new "Date" column can be used in the slicer. Then you can refer to this case:

https://community.powerbi.com/t5/Desktop/DAX-measures-based-on-MAX-and-MIN-dates-selected-in-the-Time/td-p/776468

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can make these two columns to one column with a new table.

Table 2 =
UNION (
    SELECTCOLUMNS ( 'Table', "Date", 'Table'[start] ),
    SELECTCOLUMNS ( 'Table', "Date", 'Table'[end] )
)

The new "Date" column can be used in the slicer. Then you can refer to this case:

https://community.powerbi.com/t5/Desktop/DAX-measures-based-on-MAX-and-MIN-dates-selected-in-the-Time/td-p/776468

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Ashish_Mathur
Super User
Super User

Hi,

Since you have not shared the complete question, i guess a simple way would be to build a single column in the Query Editor with all dates using the following M function in the Query Editor.

{=Number.From('Date'[Start Date])..Number.From('Date'[End Date])}


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur ,

 

I'm sorry but I don't understand yet. How to create it ?

I created new column with your syntax and I got error

eror.PNG

Is my syntax correct ?

 

Thanks

Hi,

I edited my original reply.  Please try that revised formula in the Query Editor.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.