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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Calculating across columns using IF and variable

Need: based upon a quarter selected in the filter, will calculate nine columns IF that quarter is in any of other nine columns. Details: 1. Project spending can occur 5 quarters prior to project start date, and three quarters after project start date. 2. Database has nine columns for quarter that the spend will occur. spendQtr6 in the database is calculated from project start date, while all other spendQtr columns are calculated from spendQtr6. 3. Database has nine columns for the capital$ spend. Users enter the data using a form. See example below. Problem: 1. In a matrix in Power BI the spend per quarter/year needs to be shown, regardless of which column that quarter/year is located. 2. Is there a code or a function that will look at the quarter/year columns and IF it matches a variable (based upon filter), calculate the capital columns that are associated with that quarter/year? 3. The quarter/year headings are a multi row card, which uses a variable to populate. Can that variable be used in a calculation or other script to populate the capital spending part of the matrix? Please give me some examples.
1 REPLY 1
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Could you please share sample data and clarify more details about your requirement.

 

Regards,

Jimmy Tao

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Kudoed Authors