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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kevinedora
Helper I
Helper I

All Calc Columns In One Row

Hi,

 

Please need help. I have a matrix table that looks like this

 

kevinedora_0-1660275467941.png

 

(Measure)Previous month = CALCULATE(SUM('Revenue RAW'[AMORT_AMOUNT]),PREVIOUSMONTH('Calendar Table'[Period]))

(Measure)Current Month = CALCULATE(SUM('Revenue RAW'[AMORT_AMOUNT]),PARALLELPERIOD('Calendar Table'[Period],0,MONTH))
(Measure)Variance = ([Current Month]-[Previous Month]) + 0
 
It's all good but then I wanted to add one more column saying if there was any "installs" status 3 months ago per account.
(calc column)3months Installs =
VAR _install = maxx(FILTER('OPM RAW','Revenue RAW'[ACCTNO]='OPM RAW'[ACCOUNT_NO] && 'Revenue RAW'[ITEM]='OPM RAW'[ITEM] && 'OPM RAW'[MOVEMENT]="1. INSTALLS" && year('Revenue RAW'[Period])=year('OPM RAW'[PeriodOPM])&&month('Revenue RAW'[Period])=month('OPM RAW'[PeriodOPM])+2),'OPM RAW'[MOVEMENT])
return if(_install="","N","Y")
 
The problem is if I add the calc column, it duplicates the account no if there's an install status. I wanted all of them to be in just one row. Please advise.
 
Screenshot of the duplicates if the calc column is = to "Y"
kevinedora_1-1660276086135.png
1 ACCEPTED SOLUTION

see if the attached helps you.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. Screenshots of your source data are not useful.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

@lbendlin 

Apologies, here are the sample tables:

 

Revenue Table

PeriodRevAccount_NoItemAmort Amount
2022-05200000099DSZAM931.51
2022-05200000188DSZAA859.17
2022-05200000218DSZAM931.51
2022-05200000293DSS8A232.73
2022-06200000099DSZAM907.77
2022-06200000188DSZAA831.46
2022-06200000218DSZAM907.77
2022-06200000293DSS8A225.22

 

OPM Table

PeriodOPMAccount_NoItemMovement
2022-04200000099DSZAMInstalls
2022-04200000188DSZAARecon
2022-04200000218DSZAMInstalls
2022-05200000293DSS8AInstalls

 

Result Table (should be in Matrix)

kevinedora_1-1660538153399.png

Again, I wanted all measure or calc columns to be in one row per account. The movement column is finding the movement of the account from the revenue table to the OPM table for the past 3 months(specifically 3 months beyond only) and if there are any installs. Criteria: same account and items. Other columns should be self-explanatory.

 

I hope this clarifies my concern. Thank you!

see if the attached helps you.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.