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
lpmdvip
New Member

How to add a formula to a pie chart not found in my SharePoint List

100.jpg

 

I have a SharePoint list with a downtime percentage column. In the example, the category represents downtime for those particular categories. Those two downtime categories equal 0.25136 percent. I would like to add an Uptime value that would equal 99.74864 so that the pie would equal 100% (100 - 0.25136) with those 3 parts. There will be more future categories, but would still like to subtract all of those category values from 100 to get the Uptime value. 

 

  Any suggestions would be appreciated!

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@lpmdvip,

 

Try this approach:

 

1. In Power Query, add a custom column "Type" with value "Down". Use column headings as shown below. In this example, the table name is "NetworkData".

 

DataInsights_1-1603910260588.png

 

2. Create a calculated table with the following DAX:

 

NetworkCalc = 
VAR vTotalDowntime =
    SUM ( NetworkData[% Time] )
VAR vUptime = 100 - vTotalDowntime
RETURN
    UNION ( NetworkData, { ( "Uptime", vUptime, "Up" ) } )

 

This is how the calculated table will look:

 

DataInsights_2-1603910275430.png

 

3. Create a visual using the table "NetworkCalc". I used a column chart since the data doesn't display well in a pie chart.

 

DataInsights_0-1603910227074.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
v-eqin-msft
Community Support
Community Support

Hi @lpmdvip ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,
Eyelyn Qin

v-eqin-msft
Community Support
Community Support

Hi @lpmdvip ,

Please take a look at my data sample and use the following formula:

VPN08:00:0008:00:21
SQL Databases15:32:5815:33:37
Down Time =
(
    HOUR ( MAX ( 'Table'[Down end time] ) ) * 3600
        + MINUTE ( MAX ( 'Table'[Down end time] ) ) * 60
        + SECOND ( MAX ( 'Table'[Down end time] ) )
        - HOUR ( MAX ( 'Table'[Down start time] ) ) * 3600
        - MINUTE ( MAX ( 'Table'[Down start time] ) ) * 60
        - SECOND ( MAX ( 'Table'[Down start time] ) )
) / ( 24 * 3600 )
Up Time =
1 - [Down Time]

My visualization is shown below:

10.30.2.1.PNG

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

DataInsights
Super User
Super User

@lpmdvip,

 

Try this approach:

 

1. In Power Query, add a custom column "Type" with value "Down". Use column headings as shown below. In this example, the table name is "NetworkData".

 

DataInsights_1-1603910260588.png

 

2. Create a calculated table with the following DAX:

 

NetworkCalc = 
VAR vTotalDowntime =
    SUM ( NetworkData[% Time] )
VAR vUptime = 100 - vTotalDowntime
RETURN
    UNION ( NetworkData, { ( "Uptime", vUptime, "Up" ) } )

 

This is how the calculated table will look:

 

DataInsights_2-1603910275430.png

 

3. Create a visual using the table "NetworkCalc". I used a column chart since the data doesn't display well in a pie chart.

 

DataInsights_0-1603910227074.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@DataInsights 

 

Thank you for the information, but I am receiving this notification when I build the new table. My original table UpTime Report has many columns.

 

Uptime.jpg

@lpmdvip,

 

Try this:

 

Uptime Report Calc = 
VAR vTotalDowntime =
    SUM ( 'Uptime Report'[% Time] )
VAR vUptime = 100 - vTotalDowntime
VAR vNetworkData =
    ADDCOLUMNS (
        SUMMARIZE ( 'Uptime Report', 'Uptime Report'[Category] ),
        "% Time", CALCULATE ( SUM ( 'Uptime Report'[% Time] ) )
    )
RETURN
    UNION ( vNetworkData, { ( "Uptime", vUptime ) } )




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.