cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dippnsidways
Frequent Visitor

Slight % Calculation Error

Hi All,

 

T1 has the correct values in the 'Employee' column.

I want to create another table , T2, that list the corresponding values in another column, Employee v2, except the code '0' in the 'theCode' column.

If I filter '0' out of 'theCode' column I end up with the undesired values in T3.

Below is the measurs that has been provided to me for 'Employee' column and the 'Employee v2' column.

 

 

t1 to t3.JPG

 

 

employee.JPG

 

employee v2.JPG

 

3 REPLIES 3
Super User II
Super User II

Re: Slight % Calculation Error

It is hard to see exactly what is going on because your measures references columns we cannot see and I don't know how your model looks. You are using ALLSELECTED too but I don't know how as there are no slicers or anything else showing how selection is working.

 

That said, your v1 measure is saying:
Divide the Sum of the ATB Quantity in this filter context by the Sum of the ATB Quantity for all selectect records where the theDate = the Max value of theDate. 

 

Your V2 measure is saying:
Divide the Sum of the ATB Quantity in this filter context by the Sum of the ATB Quantity for selected records but exclude any quantities where theCode <> 0.

If there are any quanties for records where theCode <> 0, then your divisor will be different (and it obviously is) so you should get a different answer.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Dippnsidways
Frequent Visitor

Re: Slight % Calculation Error

Sorry I am not being clear.

I also left out the column 'quantity' in the previous tables.

 

table with quantity.JPG

 

I want to create another table or measure that allows me to have the same values in the 'Employee' column and leave out '0' in the 'theCode' column. 

So I can have another table/measure that looks like below

 

MonthDaytheCodequantityEmployee
January2613177413.36%
January261321462.52%
January26511041.80%
January2677200.35%
January27131156313.73%
January271321491.31%
January27511241.09%
January277790.08%
January28131122214.86%
January28132760.92%
January285180.10%

 

Super User II
Super User II

Re: Slight % Calculation Error

Your FILTER() to exlcude the 0 code cannot exist if you want the results to be the same. Get rid of that filter. Just use ALL(TableName) for the filter, then filter the "0" codes out on a visual level filter in the filter pane. The calc should be the same because it will include the effect of the 0 code, but will exclude it from view.

 

If that doesn't work, please post a PBIX file. It would take someone a long time to key in all of that data and try and guess what your model is and what other filter contexts are in play to help future. You can easily share via OneDrive or DropBox. Just use fake non-confidential data.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors