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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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