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
richter2100
Regular Visitor

Need percentage of values per each month

I need help on displaying percentage of my data. I want a percentage per month, my created measue seems not working. I just counting the items per row, no numbers. 

Percentage OnTime =
COUNTROWS(FILTER('Table', 'Table'[OTD] = "On Time"))/COUNTROWS(ALL('Table'))

powerbi-help-pct.png

1 ACCEPTED SOLUTION
kcantor
Community Champion
Community Champion

@richter2100 

Can you tell me how the graph is coming up with the numbers currently displayed? Do you have a calculation for that?

To start, I would create two calculations.

OnTime = CALCULATE(COUNTROWS(Table), [OTD] = "On Time")
All = COUNTROWS(Table)
% On Time = DIVIDE([OnTime], [All])
You could even write that into one calculation using VAR but the reason I suggest two calculations is so that you can verify the results to see where the breakage occurs.  Make the three calculations and put them in a matrix side by side. This method will give you the opportunity to check what you expect.  
BTW, in my calculation the filter is implied as it is part of CALCULATE. It will save some time. I believe your use of the FILTER is creating the disconnect as it is removing the filter from the entire table . . . even the time filter.




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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
kcantor
Community Champion
Community Champion

@richter2100 

Can you tell me how the graph is coming up with the numbers currently displayed? Do you have a calculation for that?

To start, I would create two calculations.

OnTime = CALCULATE(COUNTROWS(Table), [OTD] = "On Time")
All = COUNTROWS(Table)
% On Time = DIVIDE([OnTime], [All])
You could even write that into one calculation using VAR but the reason I suggest two calculations is so that you can verify the results to see where the breakage occurs.  Make the three calculations and put them in a matrix side by side. This method will give you the opportunity to check what you expect.  
BTW, in my calculation the filter is implied as it is part of CALCULATE. It will save some time. I believe your use of the FILTER is creating the disconnect as it is removing the filter from the entire table . . . even the time filter.




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

Proud to be a Super User!




thank you seems to work now!

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.