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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
RevDan123
Frequent Visitor

Duplicate columns when using a custom column table

Hi,

I am trying to create a matrix that uses a data table for the Row Names, and a data table for the Column Names so I can drive a button based on the cell chosen. The issue I am running in to is that the matrix is getting multiples of the same columns adn I have no idea how to get rid of it. 

Any help would be greatly appreciated. 


Thanks,

Dan


Matrix Fields.PNGRow and Column Tables.PNGMatrix.PNG

 

Current Month =
SWITCH (
    TRUE(),
    SELECTEDVALUE('ReferralRows'[RowName]) = "Referrals" && SELECTEDVALUE('ReferralColumns'[ColumnName]) = "CurrentMonth",CALCULATE(COUNT('ADF FactOpportunity'[FactOpportunityID])),
    SELECTEDVALUE('ReferralRows'[RowName]) = "Not Taken Up" && SELECTEDVALUE('ReferralColumns'[ColumnName]) = "CurrentMonth",CALCULATE (COUNT('ADF FactOpportunity'[FactOpportunityID]),USERELATIONSHIP ('ADF FactOpportunity'[LostDate], 'ADF DimDate'[DimDateID])),
    SELECTEDVALUE('ReferralRows'[RowName]) = "Pipeline" && SELECTEDVALUE('ReferralColumns'[ColumnName]) = "CurrentMonth",CALCULATE(COUNT('ADF FactOpportunity'[FactOpportunityID]),'ADF FactOpportunity'[FactFindCompletedDate] <> BLANK(), 'ADF FactOpportunity'[LostDate] = BLANK(), 'ADF FactOpportunity'[FirstExchangedDate] = BLANK()),
    SELECTEDVALUE('ReferralRows'[RowName]) = "FactFinds Completed" && SELECTEDVALUE('ReferralColumns'[ColumnName]) = "CurrentMonth",CALCULATE (COUNT('ADF FactOpportunity'[FactOpportunityID]),USERELATIONSHIP ('ADF FactOpportunity'[FactFindCompletedDate], 'ADF DimDate'[DimDateID])),
    SELECTEDVALUE('ReferralRows'[RowName]) = "On Risk/Sales Completed" && SELECTEDVALUE('ReferralColumns'[ColumnName]) = "CurrentMonth",CALCULATE (COUNT('ADF FactOpportunity'[FactOpportunityID]),USERELATIONSHIP ('ADF FactOpportunity'[FirstExchangedDate], 'ADF DimDate'[DimDateID]))
)
YTD =
SWITCH (
    TRUE(),
    SELECTEDVALUE('ReferralRows'[RowName]) = "Referrals" && SELECTEDVALUE('ReferralColumns'[ColumnName]) = "YTD",TOTALYTD(COUNT('ADF FactOpportunity'[FactOpportunityID]),'ADF DimDate'[Date]),
    SELECTEDVALUE('ReferralRows'[RowName]) = "Not Taken Up" && SELECTEDVALUE('ReferralColumns'[ColumnName]) = "YTD",CALCULATE (TOTALYTD(COUNT('ADF FactOpportunity'[FactOpportunityID]),'ADF DimDate'[Date]),USERELATIONSHIP ('ADF FactOpportunity'[LostDate], 'ADF DimDate'[DimDateID])),
    SELECTEDVALUE('ReferralRows'[RowName]) = "Pipeline" && SELECTEDVALUE('ReferralColumns'[ColumnName]) = "YTD",CALCULATE (TOTALYTD(COUNT('ADF FactOpportunity'[FactOpportunityID]),'ADF DimDate'[Date]),'ADF FactOpportunity'[FactFindCompletedDate] <> BLANK(), 'ADF FactOpportunity'[LostDate] = BLANK(), 'ADF FactOpportunity'[FirstExchangedDate] = BLANK()),
    SELECTEDVALUE('ReferralRows'[RowName]) = "FactFinds Completed" && SELECTEDVALUE('ReferralColumns'[ColumnName]) = "YTD",CALCULATE (TOTALYTD(COUNT('ADF FactOpportunity'[FactOpportunityID]),'ADF DimDate'[Date]),USERELATIONSHIP ('ADF FactOpportunity'[FactFindCompletedDate], 'ADF DimDate'[DimDateID])),
    SELECTEDVALUE('ReferralRows'[RowName]) = "On Risk/Sales Completed" && SELECTEDVALUE('ReferralColumns'[ColumnName]) = "YTD",CALCULATE (TOTALYTD(COUNT('ADF FactOpportunity'[FactOpportunityID]),'ADF DimDate'[Date]),USERELATIONSHIP ('ADF FactOpportunity'[FirstExchangedDate], 'ADF DimDate'[DimDateID]))
)
1 ACCEPTED SOLUTION
RevDan123
Frequent Visitor

The thing causing my duplication is the multiple measures. I have now combined it all into one measure and it works as I want, albiet with a very long and confusing measure! Thanks for looking.

View solution in original post

2 REPLIES 2
RevDan123
Frequent Visitor

The thing causing my duplication is the multiple measures. I have now combined it all into one measure and it works as I want, albiet with a very long and confusing measure! Thanks for looking.

Anonymous
Not applicable

Hi @RevDan123 ,

Duplicates in the data model may behave as duplicates in the matrix. Check that there are no duplicate columns in the data model.

Can you provide more details about the ReferralRows and ReferralColumns table structure?

 

You can put your files in a dropbox, onedrive or googledrive folder and share the link with the community. Please provide more details with your desired out put and pbix file without privacy information.

Please refer to the related links for details:

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

How to Get Your Question Answered Quickly - Microsoft Fabric Community

 

Best Regards,

Ada Wang

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

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.