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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
stchln
Resolver I
Resolver I

Power BI Tooltip with argument

Hello all,

 

I would like to create add a pop-up window on top of a table to show a curve of progress of actual vs plan to raise an alarm if I am late with some tasks. The issue I have is that I don't know how to pass an argument (holdover task) to the tooltip that is currently hardcoded for task "T1&.

 

Any idea? 

 

 

stchln_0-1669046960234.png

 

Table : Input data

 

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjFU0lEyMNQ3NNQ3MjAygnKMYBxDAwMgaWygFKsDVAsWMUVSa2SMpNYIrNYEotQYZJIFslJLJI6hKVgp0NhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [task = _t, start = _t, end = _t, planned = _t, actual = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"task", type text}, {"start", type date}, {"end", type date}, {"planned", Int64.Type}, {"actual", Int64.Type}})
in
    #"Changed Type"

 

 

 

 

YX : created table

 

 

 

YX = 
// S Curve is business functions
// https://businessfunctions.com/articles/The%20Origins%20of%20the%20S%20Curve%20in%20Business%20Functions.pdf
Var _T = "T1"
Var _s = LOOKUPVALUE('Table'[start],'Table'[task],_T,0)
Var _e = LOOKUPVALUE('Table'[end],'Table'[task],_T,0)
Var _a = LOOKUPVALUE('Table'[actual],'Table'[task],_T,0)
Var _p = LOOKUPVALUE('Table'[planned],'Table'[task],_T,0)
Var _s2e = DATEDIFF(_s,_e,DAY)
Var _s2c = DATEDIFF(_s,TODAY(),DAY)
RETURN
GENERATE(
        GENERATESERIES(0,_s2e,1),
        VAR _scurve = IF ([Value]<0,0,IF([Value]>_s2e,1,_p/2*(1-COS(PI()*[Value]/_s2e))))
        VAR _current = IF ([Value]<0,0,IF([Value]>_s2c,BLANK(),(_a/_s2c)*[Value]))
        RETURN ROW("s-curve",_scurve,"actual",_current)
)

 

 

 

 

Thanks for your help!

1 ACCEPTED SOLUTION

Hello,

one of my colleagues - thanks to Jacques - could help me to solve my issue. He adviced me to go with measurements as he explained to me, tooltip is receiving data below the cursor on "parent" visual.

 

then solution for my case is as below

 

1. Table creation

Dates = GENERATESERIES(MIN('Table'[start]), MAX('Table'[end]))

 

actual measure

actual = 
VAR _T = SELECTEDVALUE('Table'[task])
VAR d = SELECTEDVALUE(Dates[Day])
Var _s = LOOKUPVALUE('Table'[start],'Table'[task],_T,0)
Var _e = LOOKUPVALUE('Table'[end],'Table'[task],_T,0)
Var _a = LOOKUPVALUE('Table'[actual],'Table'[task],_T,0)
RETURN IF(d<_s, BLANK(), IF(d>TODAY(), BLANK(), _a*(DATEDIFF(d, _s, DAY)/DATEDIFF(_e, _s, DAY))))

 

s-curve measure

s-curve = 
VAR _T = SELECTEDVALUE('Table'[task])
VAR d = SELECTEDVALUE(Dates[Day])
Var _s = LOOKUPVALUE('Table'[start],'Table'[task],_T,0)
Var _e = LOOKUPVALUE('Table'[end],'Table'[task],_T,0)
Var _a = LOOKUPVALUE('Table'[actual],'Table'[task],_T,0)
Var _p = LOOKUPVALUE('Table'[planned],'Table'[task],_T,0)
Var _s2e = DATEDIFF(_s,_e,DAY)
Var _s2c = DATEDIFF(_s,TODAY(),DAY)
RETURN IF(d<_s, BLANK(), IF(d>_e, BLANK(), _p*(1-COS(PI()*(DATEDIFF(d, _s, DAY)/DATEDIFF(_e, _s, DAY))))))

 

This is solving my issue.

 

View solution in original post

2 REPLIES 2
v-yadongf-msft
Community Support
Community Support

Hi @stchln ,

 

In order to better understanding your demands and give the right solution, could you please share with me some screenshots of your data after hiding sensitive information and tell me what's your expected output?

 

Thanks for your efforts & time in advance.

 

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.

Hello,

one of my colleagues - thanks to Jacques - could help me to solve my issue. He adviced me to go with measurements as he explained to me, tooltip is receiving data below the cursor on "parent" visual.

 

then solution for my case is as below

 

1. Table creation

Dates = GENERATESERIES(MIN('Table'[start]), MAX('Table'[end]))

 

actual measure

actual = 
VAR _T = SELECTEDVALUE('Table'[task])
VAR d = SELECTEDVALUE(Dates[Day])
Var _s = LOOKUPVALUE('Table'[start],'Table'[task],_T,0)
Var _e = LOOKUPVALUE('Table'[end],'Table'[task],_T,0)
Var _a = LOOKUPVALUE('Table'[actual],'Table'[task],_T,0)
RETURN IF(d<_s, BLANK(), IF(d>TODAY(), BLANK(), _a*(DATEDIFF(d, _s, DAY)/DATEDIFF(_e, _s, DAY))))

 

s-curve measure

s-curve = 
VAR _T = SELECTEDVALUE('Table'[task])
VAR d = SELECTEDVALUE(Dates[Day])
Var _s = LOOKUPVALUE('Table'[start],'Table'[task],_T,0)
Var _e = LOOKUPVALUE('Table'[end],'Table'[task],_T,0)
Var _a = LOOKUPVALUE('Table'[actual],'Table'[task],_T,0)
Var _p = LOOKUPVALUE('Table'[planned],'Table'[task],_T,0)
Var _s2e = DATEDIFF(_s,_e,DAY)
Var _s2c = DATEDIFF(_s,TODAY(),DAY)
RETURN IF(d<_s, BLANK(), IF(d>_e, BLANK(), _p*(1-COS(PI()*(DATEDIFF(d, _s, DAY)/DATEDIFF(_e, _s, DAY))))))

 

This is solving my issue.

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.