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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
NB689
Helper I
Helper I

Dynamic Title that matches the SLICER's selection instead of MAX range in my current data

Hi everyone,

 

I have a table that shows a list of projects and a few different values for each project. Two values that we have created slicers for are the "Open Date" and "% of Confidence". What I would like to show in the Title is the value entered into the slicer, not the MAX value that I currently have available in my data.

 

My data visuals look like this: 

Screenshot 2022-03-25 091827.png

What I would like for it to show (to match my data slicers): "Project Activity (Next 15 Days, 25+% Confidence"

 

My DAX Measure that I am currently using for my dynamic title looks like this:

Title 1 = 

"Project Activity (Next " & MAX (Append1[Open Date minus Today]) & " Days, " & MIN (Append1[% of Confidence]) & "+% Confidence"

 

I think that I either need to find a way to add a full range of all dates and confidence percentages for the "MAX" feature to show in the title correctly, but I'm really not sure on how to achieve that.

 

Thank you!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

@NB689 
Here is a sample file with the solution https://www.dropbox.com/t/TNd8TRAhoEb7fxLT
First you need to create a simple date table

Date = CALENDAR ( TODAY ( ), DATE ( YEAR ( MAX ( Append1[Open Date] ) ), 12, 31 ))

Then create the % confidence selection table

% of Confidence Selection = 
SELECTCOLUMNS ( GENERATESERIES ( 0, 100, 1 ), "% of Confidence", [Value] )

Then create the relationships
1.png
The tilte measure would be

Title 1 = 
VAR NumberOfDays =
    CALCULATE(
        DATEDIFF ( TODAY(), MAX ('Date'[Date] ), DAY ) + 1,
        CROSSFILTER ( 'Date'[Date], Append1[Open Date], None )
    )
VAR Confidence =
    CALCULATE ( 
        MIN ('% of Confidence Selection'[% of Confidence] ),
        CROSSFILTER ( 'Date'[Date], Append1[Open Date], None )
    )
RETURN
"Project Activity (Next " & NumberOfDays & " Days, "
    & Confidence & "+% Confidence"

And this is how the report looks like
2.png

View solution in original post

6 REPLIES 6
tamerj1
Super User
Super User

@NB689 
Here is a sample file with the solution https://www.dropbox.com/t/TNd8TRAhoEb7fxLT
First you need to create a simple date table

Date = CALENDAR ( TODAY ( ), DATE ( YEAR ( MAX ( Append1[Open Date] ) ), 12, 31 ))

Then create the % confidence selection table

% of Confidence Selection = 
SELECTCOLUMNS ( GENERATESERIES ( 0, 100, 1 ), "% of Confidence", [Value] )

Then create the relationships
1.png
The tilte measure would be

Title 1 = 
VAR NumberOfDays =
    CALCULATE(
        DATEDIFF ( TODAY(), MAX ('Date'[Date] ), DAY ) + 1,
        CROSSFILTER ( 'Date'[Date], Append1[Open Date], None )
    )
VAR Confidence =
    CALCULATE ( 
        MIN ('% of Confidence Selection'[% of Confidence] ),
        CROSSFILTER ( 'Date'[Date], Append1[Open Date], None )
    )
RETURN
"Project Activity (Next " & NumberOfDays & " Days, "
    & Confidence & "+% Confidence"

And this is how the report looks like
2.png

That worked! Thank you so much

tamerj1
Super User
Super User

Hi @NB689 

You can try

Title 1 =
"Project Activity (Next " & SELECTEDVALUE ( Append1[Open Date minus Today] ) & " Days, "
    & SELECTEDVALUE ( Append1[% of Confidence] ) & "+% Confidence"

When I try that I'm getting this.

 

Screenshot 2.png

One idea came to my mind is that you can create a filter table with the just the numbers between 0% - 100% and then create a relationship between this table and your table via the % of confidance column. When the slicer is based on this column then we can retrieve the exact Min and Max. 
Regarding the time as I mentioned in my previous reply, just subtract the MAX - MIN to get the number of days

We can use the following to retrieve the number of days

MAX( Append1[Open Date minus Today] ) - MIN ( Append1[Open Date minus Today] )

 However, I have no idea how to retrieve the value of a slicer. I'm interested to know as well

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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