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
GAURAVG
Helper I
Helper I

Date Slicer with multiple columns

Hello all,

I have a table "Table1", which has few requirements and 3 columns having the dates in which they were in various states(draft,inProgress,closed).See table below.

I then have 3 visuals date wise, for each state. 1 for draft, 1 for InProgress,1 for Closed.

Now i want a single relative date slicer, which if i say filter for last 3 months, applies to all visuals.

Currenty if i filter Closed last 3 months,in a date slicer, for the draft visual, it also shows R4, which i dont want.Iwant it to apply last 3 months for all visuals.

Any idea on this?

 

RequirementDraftInProgressClosed
R110-May-2120-Jun-2110-Jul-21
R210-May-2120-Jun-2115-Jul-21
R315-May-2105-Jul-2110-Aug-21
R422-Jul-2110-Aug-2103-Oct-21
R528-Aug-2130-Aug-2110-Oct-21
7 REPLIES 7
v-janeyg-msft
Community Support
Community Support

Hi, @GAURAVG 

 

vjaneygmsft_1-1638516476329.png

If you want to use date slicer, the context will change, and you won't be able to filter multiple columns of data in one step.

There are a simple workaround, but you need to use the measure to all visuals' filter pane.

Create a single date table, and create e measure to filtere three date columns in filter pane.

Like this:

 

 

Table 2 = CALENDARAUTO()
Measure =
IF (
    MAX ( 'Table'[Draft] )
        IN DISTINCT ( 'Table'[Draft] )
            && MAX ( 'Table'[InProgress] )
                IN DISTINCT ( 'Table 2'[Date] )
                    && MAX ( 'Table'[Closed] ) IN DISTINCT ( 'Table 2'[Date] ),
    1,
    0
)

 

 

 

 

vjaneygmsft_2-1638516866337.png

 

If the relative date is fixed, you can use the calculated column to filter in all visuals.

Like this:

vjaneygmsft_3-1638518618965.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

 

Best Regards,
Community Support Team _ Janey

Thank you for the reply. My relative date is not fixed.

But if you see from your calculated column example, after i filer for "Last 3 months"R4 is also considered for Draft and In Progress visuals..But for R4 Draft was way back in Aug(08), and hence in the visual, it should not show up.

Also for the measure,I would however have to create arelationship between the Table2 and table 1.Else i wont be able to apply filter on visuals.Isnt that correct?

Hi, @GAURAVG 

 

If you download  and check my sample, you won't say that the result is incorrect... The data you provided didn’t match the results for the last 3 months, so I changed the date.

vjaneygmsft_1-1638781808063.png

And the easiest way to use measure I have given. Other methods, such as what amit said, are not applicable to all visuals at once. It also needs to be customized according to your needs. If you want to use his method, I suggest you check the documentation carefully.

vjaneygmsft_2-1638781909944.png

USERELATIONSHIP function (DAX) - DAX | Microsoft Docs

HR Analytics - Active Employee, Hire and Terminati... - Microsoft Power BI Community

 

Best Regards,
Community Support Team _ Janey

 

amitchandak
Super User
Super User

@GAURAVG , You need to create a date table and join all dates with that. That will create one active and other inactive joins

You can activate the join userealtionship

 

Refer example

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Hello,

I have tried creating a CalendarAuto table and then creating a relationship between [Table1][Draft] and Calendar[Date]. But, i can only create a One-to-Many relationship.It should ideally be a Many-One relationship. If i change cardinality, i get the error as "The cardinality you selected isnt valid". I am guessing this occurs, as i have more than 1 req with same Draft date

@GAURAVG , Create date table using calendar , based these take some Min start and Max year end date and try

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

I tried that too, but i get same cardinality..One-Many

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.