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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rouelandrew
Frequent Visitor

Free text consequtive month filter based on another filter on the report

Hello,

 

So the client wants to have a dashboard that looks like this, where the input filters include the Account name, a free text slicer where they can input a designated SLA, and another free text slicer to input number of months where a unit was below SLA.

 

In the example below, it's filtering only those units that were below 98.5% SLA for 3 months.

 

rouelandrew_0-1713477790084.png

 

I managed to create almost everything that they are asking for except for the consequtive month free text filter since I don't know where to start. The resulting table was created using a Matrix visualization since both month and SLA's where rows in the dataset (See sample below).

 

Is there a way to do this or do I have to let them know that we are gonna have to fig

 

rouelandrew_1-1713478128744.png

 

 

 

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

Hi @rouelandrew ,

Since you didn't provide sample data, I can only create a simple sample data myself to give you an example.
Here is my sample data:

vjunyantmsft_0-1713491145222.png

Then I add two tables for Month Slicer and Target Slicer:

vjunyantmsft_1-1713491181541.pngvjunyantmsft_2-1713491189571.png

Here is the relationship view:

vjunyantmsft_3-1713491210793.png

Then I use this DAX to create a measure:

Measure = 
VAR Today = TODAY()
VAR Select_Month = SELECTEDVALUE('Month'[Month])
VAR Target_Day = EOMONTH(TODAY(), -Select_Month) + 1
RETURN
IF(
    ISFILTERED(SLA_Target[SLA_Target]),
    IF(
        MAX('Table'[SLA]) < SELECTEDVALUE(SLA_Target[SLA_Target]) && MAX('Table'[Date]) <= TODAY() && MAX('Table'[Date]) >= Target_Day,
        1,
        0
    ),
    1
)

Set the settings according to the following screenshot:

vjunyantmsft_4-1713491314345.png
vjunyantmsft_5-1713491351450.png

The final output is as below:

vjunyantmsft_6-1713491391164.png


Best Regards,
Dino Tao
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

1 REPLY 1
v-junyant-msft
Community Support
Community Support

Hi @rouelandrew ,

Since you didn't provide sample data, I can only create a simple sample data myself to give you an example.
Here is my sample data:

vjunyantmsft_0-1713491145222.png

Then I add two tables for Month Slicer and Target Slicer:

vjunyantmsft_1-1713491181541.pngvjunyantmsft_2-1713491189571.png

Here is the relationship view:

vjunyantmsft_3-1713491210793.png

Then I use this DAX to create a measure:

Measure = 
VAR Today = TODAY()
VAR Select_Month = SELECTEDVALUE('Month'[Month])
VAR Target_Day = EOMONTH(TODAY(), -Select_Month) + 1
RETURN
IF(
    ISFILTERED(SLA_Target[SLA_Target]),
    IF(
        MAX('Table'[SLA]) < SELECTEDVALUE(SLA_Target[SLA_Target]) && MAX('Table'[Date]) <= TODAY() && MAX('Table'[Date]) >= Target_Day,
        1,
        0
    ),
    1
)

Set the settings according to the following screenshot:

vjunyantmsft_4-1713491314345.png
vjunyantmsft_5-1713491351450.png

The final output is as below:

vjunyantmsft_6-1713491391164.png


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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.