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
lc1
Helper III
Helper III

Same formula, different results for some months

Hello,

Please see below, when dividing PAR_HOURS by FT-CE Sched Hr the correct result should be around 20%.

Why does the formula work for some months and not others? (See Feb and April)

Thanks

 

 

PPE_DTPAR_HOURSFT-CEFT-CE Sched HrPAR_HOURS divided by FT-CE Sched Hr
2/9/2019 0:0089514753800012%
2/23/2019 0:0080034753800011%
3/9/2019 0:0080514723776021%
3/23/2019 0:0081194863888021%
4/6/2019 0:0084074853880011%
4/20/2019 0:0081264853880010%
5/4/2019 0:0083114833864022%
5/18/2019 0:0073404823856019%
6/1/2019 0:0066774803840017%
8 REPLIES 8
TeigeGao
Solution Sage
Solution Sage

Hi @lc1 ,

Please create a calculated column with the following DAX query:

PAR_HOURS divided by FT-CE Sched Hr = DIVIDE(Table1[PAR_HOURS],Table1[FT-CE Sched Hr])

The result will like below: 

PBIDesktop_Qd7rbrySnU.png

We can also create a measure like below:

PAR_HOURS divided by FT-CE Sched Hr 2 = DIVIDE(MIN(Table1[PAR_HOURS]),MIN(Table1[FT-CE Sched Hr]))

The result will like below:

PBIDesktop_H8xHCH70Sa.png

Best Regards,

Teige

Neither of the options worked.

My original formula giving me the wrong results in Feb and April was:

DIVIDE(
    SUM('Absenteeism'[PAR_HOURS]),
    SUM('Bus Oper-Filled Full Time'[FT-CE Sched Hr])
)
 
When I used the one below, it can't find the second table (two different tables)
PAR_HOURS divided by FT-CE Sched Hr = DIVIDE(Table1[PAR_HOURS],Table1[FT-CE Sched Hr])
 
And lastly when I used the second option recommend, the result is all 0%
PAR_HOURS divided by FT-CE Sched Hr 2 = DIVIDE(MIN(Table1[PAR_HOURS]),MIN(Table1[FT-CE Sched Hr]))
 
Anonymous
Not applicable

PBI percentage.PNG

 

The formula

 
NEW PERCENTAGE = Table2[PAR_HOURS] / Table2[FT-CE Sched Hr]
 
worked fine for me...
 
May be a formatting issue with your source data or in the query. Make sure the PAR_Hours and FT-CE Sched Hr are set to Whole Number.
 

I can't use that formula because the values are coming from different tables/sources. The hours are coming from a database where I have to sum all daily par hours per employees, per garage to get the total you see in the example below and the Scheduled hours are coming from an excel table.

What I find weird is that it works for some months and not for the others...

 

Anonymous
Not applicable

I am confused. Why can't you use that formula? Is your screenshot not what your data looks like in PBI?

 

The screenshot is based on the original formula:

PAR_HOURS divided by FT-CE Sched Hr =
DIVIDE(
    SUM('Absenteeism'[PAR_HOURS]),
    SUM('Bus Oper-Filled Full Time'[FT-CE Sched Hr]))
 
Which works for all months except Feb and April. I looked at the data and all values/format seem to be consist when compared one month to the other.
Anonymous
Not applicable

Can you post the formula you are using?

 

Did you make many edits in the query editor that effected either of these columns*?

Original formula:

PAR_HOURS divided by FT-CE Sched Hr =
DIVIDE(
    SUM('Absenteeism'[PAR_HOURS]),
    SUM('Bus Oper-Filled Full Time'[FT-CE Sched Hr])
)
 
And no changes were made in the query editor.

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.