Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
JDJohnson8783
Frequent Visitor

Calculation of 4 columns and need to filter rows that a fifth column does not contain V or VS

Hello,

 

New to Power BI. Need some help.

I am trying to figure out COPQ. I am taking and adding columns [LAB]+[MAT]+[OH] and dividing by [Revenue] and this will give me my COPQ percentage. But i need to filter out any row that contains "VS" or "V". I have tried the filter in the filter section of the gui interface but when i try to filter there it messes with my revenue numbers as well.

Any ideas?

2 REPLIES 2
JDJohnson8783
Frequent Visitor

Ok let me see if this is a better explanation. I have a table from an ODBC query and a table from an excel query. Here is the excel table:

help1.PNG

 the highlighted columns are the columns i am using for this situation.

Here is the ODBC table:

help 2.PNG

 

I am only using the revenue data from this table.

So using a measure i am able to pull the data from both tables and calulate COPQ by using this code:

Measure = IF(SUM(V_ORDER_HIST_LINE[Revenue]) = 0, 0, (SUM('Scrap and Rework Costs'[LAB]) + SUM('Scrap and Rework Costs'[MAT]) + SUM('Scrap and Rework Costs'[OH])) / SUM(V_ORDER_HIST_LINE[Revenue])
This code works fine with the data it is pulling, the problem is when i put a filter on the visual to leave out any suffix beginning with "V" it adjusts the revenue which i do not want it to do. 
I could seperate the data that the suffix with V onto another excel spreadsheet and query that table as well but i want to figure out how to filter this as is.
FYI i do not have a Union set up on these tables and the only relationship between these tables is the invoice date.
 
Any help is appreciated.
edhans
Super User
Super User

How to get good help fast. Help us help you.

How To Ask A Technical Question If you Really Want An Answer

How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.



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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors