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
Almiwork
Frequent Visitor

Measure misbehaving when adding more columns to matrix

Hi all,

I'm in need of a measure that allows me to distribute sales coming from sub_channelgrouping = Unknown into my other rows. This should be based on the share that each row have of the total sales without unknowns. I've got my measure to work when the only category column inside my table is sub_channelgrouping. But i would like to be able to add more columns to the matrix without disrupting the measure.
First picture: working totally as intended

Almiwork_2-1646685705020.png

 

 


Second picture: no longer splits out the "unknown" into the other rows

Almiwork_1-1646685676251.png

 

 



Measure used for the sales adjusted: 

IF(SELECTEDVALUE('Table'[Sub_ChannelGrouping]) in {"Unknown"} || isblank(SELECTEDVALUE('Table'[Sub_ChannelGrouping])) , BLANK(),
SUM('Table'[sales]) + (CALCULATE(SUM('Table'[sales]), 'Table'[Sub_ChannelGrouping] = "Unknown") * SUM('Table'[sales])/CALCULATE(SUM('Table'[sales]), 'Table'[Sub_ChannelGrouping] <> "Unknown")))
 
Update: Fixed by adding a "Removefilters" to the main_channelgrouping. Also note that if you are sorting the sub or main channelgrouping, you would have to remove that filter aswell!
 
6 REPLIES 6
amitchandak
Super User
Super User

@Almiwork , You need to consider, You need to divide first or Multiply, that can make a lot of diff. as of now it is multiplication first.

 

IF(SELECTEDVALUE('Customer Status & Traffic Sales'[Sub_ChannelGrouping]) in {"Unknown"} || isblank(SELECTEDVALUE('Customer Status & Traffic Sales'[Sub_ChannelGrouping])) , BLANK(),
SUM('Customer Status & Traffic Sales'[actual_sales]) + (CALCULATE(SUM('Customer Status & Traffic Sales'[actual_sales]), 'Customer Status & Traffic Sales'[Sub_ChannelGrouping] = "Unknown") * SUM('Customer Status & Traffic Sales'[actual_sales])/CALCULATE(SUM('Customer Status & Traffic Sales'[actual_sales]), 'Customer Status & Traffic Sales'[Sub_ChannelGrouping] <> "Unknown")))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Not sure what you mean by divide or multiply first? 
Your listed code produced exactly the same outcome as mine, doesn't work when adding the second column to the table.

@Almiwork , I have done only chance in if. But this part you need to revisit

 

(CALCULATE(SUM('Customer Status & Traffic Sales'[actual_sales]), 'Customer Status & Traffic Sales'[Sub_ChannelGrouping] = "Unknown") * SUM('Customer Status & Traffic Sales'[actual_sales]) / CALCULATE(SUM('Customer Status & Traffic Sales'[actual_sales])

 


Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, @Almiwork 

Access Denied. Can you check if your sample file is set to "Public on the web" in the Google Drive link sharing window?

 

Best Regards,
Community Support Team _ Eason

The order of multiplication and division doesn't matter fyi?
I'll see if I can work together a sample dataset

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.