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

How to create a visual object with a dynamic information

Hi all


I need to create a card with a text that will change based on the result of the calculation of the median of the time to restore. Let me give an example

 

walterdp_0-1673376047786.png

 

The graphic shows the median time to restore tickets. The field Time to Restore was calculated by sustracting end date to start date, add that value in the Y axis and select Median. Then I added the card with various rows and add field Time to Restore and again, change display to show Median. So far, so good.

 

Problem is that I want to add a card that, based on the previous value, can say if the Median to Restore is

 

One Day

One Week

One Month

Six Months

One Year

 

So I guess I need to create a measure that can give me the same value I got in the previous card and based on that result and comparing, display the text specific text.

Something like

 

If (median of time to resolve) <= 24 then "One Day" else

     if (median of time to resolve) <= 168 "One week" else... 

 

Problem is, I don't know how to translate that to actual code in Power BI ! 😞

 

Any help would be much appreciated!

1 ACCEPTED SOLUTION
walterdp
Helper I
Helper I

Hi all:

 

With the help of a team mate we found the solution and it was a very simple one (I feel very stupid by the way).

Estados = IF(MEDIAN('Incs Cerrados (dic 2022)'[Tiempo Resolución])<=24, "Diario", 
IF(MEDIAN('Incs Cerrados (dic 2022)'[Tiempo Resolución])<=168, "Semanal", 
IF(MEDIAN('Incs Cerrados (dic 2022)'[Tiempo Resolución])<= 720, "Mensual", "Anual")))

 

View solution in original post

2 REPLIES 2
walterdp
Helper I
Helper I

Hi all:

 

With the help of a team mate we found the solution and it was a very simple one (I feel very stupid by the way).

Estados = IF(MEDIAN('Incs Cerrados (dic 2022)'[Tiempo Resolución])<=24, "Diario", 
IF(MEDIAN('Incs Cerrados (dic 2022)'[Tiempo Resolución])<=168, "Semanal", 
IF(MEDIAN('Incs Cerrados (dic 2022)'[Tiempo Resolución])<= 720, "Mensual", "Anual")))

 

lbendlin
Super User
Super User

use the SWITCH() statement. 

 

Please provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

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.