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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
alecjbeckett
Frequent Visitor

True or False Percent Gauge

Hi All,

 

I am trying to convert the below table to a gauge.

 

What i would like to have the gauge show Cases solved that are TRUE as a percentage of the total number of CASE IDs.

 

Bit of a powerbi novice and struggling to get the percentage feature of the gauge to recognise the values.

 

Any help would be appreciated!

 

Thanks

 

Case IDCase Solved?
1000TRUE
1001FALSE
1002TRUE
1003TRUE
1004TRUE
1005FALSE
1006FALSE
1007TRUE
1008TRUE
1009TRUE
1010TRUE

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Create 3 Measures.  First measure would be a simple "CountRows" measure.  That will give you the total number of cases.  This measure will change depending on your filter context.  Next create a 2nd measure which is going to count the number of True rows, this can be done doing something like:

CountTrue = CALCULATE(
    COUNTROWS('YourTable'),
    'YourTable'[Case Solved?] = TRUE()
)

Lastly the 3rd measure is what is your percentage, which will be the [CountTrue] / [CountAll]

 

View solution in original post

10 REPLIES 10
v-huizhn-msft
Employee
Employee

Hi @alecjbeckett,

>>Bit of a powerbi novice and struggling to get the percentage feature of the gauge to recognise the values.

It's still confusing, how to recognise the values? For gauge visual, there are min, max and target value, you want to the target shows the solved percentage? Please share more details for further analysis.

You can create the number of solved IDs and percentage using the following formula.

Count True = CALCULATE(COUNTROWS(Table1),FILTER(Table1,Table1[Case Solved?]=TRUE()))

Percentage = CALCULATE(Table1[Count True]/CALCULATE(COUNTROWS(Table1),ALL(Table1)))

 

You want to display your result as follows?

1.PNG

Best Regards,
Angelia

Anonymous
Not applicable

Create 3 Measures.  First measure would be a simple "CountRows" measure.  That will give you the total number of cases.  This measure will change depending on your filter context.  Next create a 2nd measure which is going to count the number of True rows, this can be done doing something like:

CountTrue = CALCULATE(
    COUNTROWS('YourTable'),
    'YourTable'[Case Solved?] = TRUE()
)

Lastly the 3rd measure is what is your percentage, which will be the [CountTrue] / [CountAll]

 

How can we visualizre this?

 

I created the "CountRows" measure already. I calculated the difference between two dates and for each row has difference, the answer is a number. Can you tell me what I should do to know the percentage of the rows they are 0, dates are same?

 

Thanks

Anonymous
Not applicable

Hi @Guyloucou, i'd love to help you but I can't for the life of me work out what you are asking.  Your question didn't seem to make any sense.

Sorry, my first language is French. Let me give you more details. I would like to write a measure to know how many projects are deliver to the target date anticipate. Can you help me?

Anonymous
Not applicable

Something like:

CountTrue = CALCULATE(
    COUNTROWS('YourTable'),
    'YourTable'[Completed] = TRUE(),
    'YourTable'[DeliveredDate] <= 'YourTable'[TargetDate]
)

Thank you Ross, I tried this and I received an error message:

 

CountTrue = CALCULATE(

COUNTROWS('My Table'),

'My table'[Total days delay design] = TRUE(),

'My table'[Design closing date] <= 'My table[Design requestdate]

 

The expression contains multiple columns, but only a single colomn can be used in a True/False expression that is used as a table filter expression.

 

In the column "Total days delay design" sometimes I have a number of days and sometimes nothing. Can you tell me what is wrong, please.

 

Thanks in advance 🙂

 

Anonymous
Not applicable

Looks like i've stuffed up and given you a bum steer.  Ok lets go another direction.  Create a new custom column with the formula:

CountMe = IF(
	'My table'[Design closing date] <= 'My table[Design requestdate],
	1,
	0
)

Then use it within:

CountTrue = CALCULATE(
	COUNTROWS('My Table'),
	'My table'[Total days delay design] = TRUE(),
	'My table'[CountMe] = 1
)

 

Thank you both.

 

Ross' was best for my data. Appreciate the help

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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