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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Referencing another query in custom column

Hi - I have a query that has one value in it.  I want to take that value, and divide it by the number of rows in another query. Then, subtract that value from all the rows in that second query.  I created a measure that taskes the single value and divides it by the row count, and that worked.  But I can't figure out how to reference the unique value produced by that measure and reduce every row by that value.  

 

E.g. I have a query (Query1) that I filtered down to just be 1 row, 1 column.  The value of that cell is $639,792.  On the visual screen, I did a quick measure that divided the $639,792 by the total number of rows (which for me is a count of how many weeks) in another query (Query2).  The value came out to $4300.  I now want to take that $4300 and subtract it from every row in Query2 in a custom column. For the sake of time, I have done a manual "subtract" of the $4300 to work for my presentation today, but I'd like it to be automated.  

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a calculated column on Table Monthly RMP Forecast.

vtangjiemsft_0-1706752873466.png

Column =
[RMP]
    - DIVIDE (
        MIN ( 'Anticipated PTO'[Anticipated PTO $ Value Total] ),
        COUNTROWS ( ALL ( 'Monthly RMP Forecast' ) ),
        0
    )

(3) Then the result is as follows.

vtangjiemsft_1-1706752970193.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a calculated column on Table Monthly RMP Forecast.

vtangjiemsft_0-1706752873466.png

Column =
[RMP]
    - DIVIDE (
        MIN ( 'Anticipated PTO'[Anticipated PTO $ Value Total] ),
        COUNTROWS ( ALL ( 'Monthly RMP Forecast' ) ),
        0
    )

(3) Then the result is as follows.

vtangjiemsft_1-1706752970193.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Anonymous
Not applicable

That worked! Thank you.  If we wanted to count rows based on the week ending column and only count rows that are after TODAY(), how would we do that?

Anonymous
Not applicable

I want to take column "RMP" in Query "Monthly RMP Forecast" and minus "Anticipated PTO" (from another query)/Table.RowCount (from "Monthly RMP Forecast")

EmilyGTH_1-1706716631548.png

 

EmilyGTH_2-1706716695481.png

 

Anonymous
Not applicable

It would be even better if I could just subtract is from the rows whose date is in the future.  

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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