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

Measure that shows percentage of not overdue tasks

HI all,

 

I have a measure that shows the count of not overdue tasks. I need it to show the percentage instead.

This is the measure:

 

Not OverdueTasks = CALCULATE( COUNTROWS('Sheet1'), FILTER( 'Sheet1', 'Sheet1'[Overdue] = FALSE() ) )+0
 
I need it in percentage to show it in a KPI visual.
Sonnet_0-1709157421060.png

 

The KPI should compare data from previous year. Could you also check that the target measure is correct please?

Prev1Year = CALCULATE([Not OverdueTasks], PARALLELPERIOD('Calendar'[Date],-1,YEAR))
 
Sample Data:
 
IDNameOpening DateCompletion DateTask Type 
PT00001Name 0000124/08/202301/02/2024Project 
PT00002Name 0000211/09/202328/02/2024Task 
PT00003Name 0000322/09/202324/12/2023Assignment 
PT00004Name 0000413/10/2023 Support Ticket 
PT00005Name 0000511/09/202309/01/2024Project 
PT00006Name 0000606/10/202318/10/2024Task 
PT00007Name 0000719/10/202302/02/2024Assignment 
PT00008Name 0000816/11/202320/11/2023Support Ticket 
PT00009Name 0000917/11/2023 Project 
PT00010Name 0001020/11/202321/11/2023Support Ticket 
PT00011Name 0001121/11/202301/12/2023Support Ticket 
PT00012Name 0001222/11/202322/11/2023Support Ticket 
PT00013Name 0001309/12/2023 Project 
PT00014Name 0001424/12/202309/01/2024Task 
PT00015Name 0001518/01/2024 Assignment 
PT00016Name 0001620/01/202428/01/2024Support Ticket 
PT00017Name 0001710/01/202420/01/2024Support Ticket 
PT00018Name 0001831/01/202411/04/2024Task 
PT00019Name 0001922/02/2024 Assignment 

 

Because I can't upload a .pbix file, I add other formula to help you build the data set as in my .pbix file.

 

Expected_Completion_Date =
SWITCH (
'Sheet1'[Task Type],
"Project", 'Sheet1'[Opening Date] + 180,
"Assignment", 'Sheet1'[Opening Date] + 90,
"Task", 'Sheet1'[Opening Date] + 14,
"Support Ticket", 'Sheet1'[Opening Date] + 3,
BLANK ()
)

Overdue = IF(ISBLANK([Completion Date]), TODAY() > [Expected_Completion_Date], [Completion Date] > [Expected_Completion_Date])

Any help is much appreaciated.
1 REPLY 1
v-huijiey-msft
Community Support
Community Support

Hi @Sonnet ,

 

After my testing, I found that the percentage cannot be directly dragged into the KPI visual for display.

 

If you want to learn more about KPI visuals, please see:

Key Performance Indicator (KPI) visuals - Power BI | Microsoft Learn

 

If you want to display ‘Not OverdueTasks’ as a percentage, please try:

NotOverdueTasks = FORMAT(DIVIDE(
     CALCULATE( COUNTROWS('Sheet1'), FILTER( 'Sheet1', [Overdue] = FALSE() )),
     CALCULATE(COUNTROWS('Sheet1'),ALL(Sheet1))
),
"Percent")

vhuijieymsft_0-1709195929415.png

 

I have not found any problems with your 'Prev1Year' for the time being, and the logic is correct.

 

If you have any further questions please feel free to contact me.

 

pbix file is attached.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

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.

Top Solution Authors