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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
sydney20
New Member

Matrix Table - keeps on repeating

Hi! Would appreciate insights on where my model is going wrong.

I have these tables:

(1) Base headcount of employees w/c I am planning to use as dimension

(2) Data that would be used for the measures - this table has a person identifier that could be linked to table 1

(3) Dimension table for Region, Business Unit and Country

 

Basically, the stakeholder would want a visual and table that shows how many employees meets the metrics and how many are not. So the table 1 have a mapping of region and business unit per employee w/c was then connected to table 3.

 

Now, the issue is the matrix table. Since they would want as well the list of workers that does not have data in table 2, I have added +0 at the latter part of the DAX that simply count the rows, sum some data, etc. What happens is that, if I visualize it as a table: Region - Business Unit - Worker, the worker appears to ALL regions and BUs w/c should not be the case.

 

Any insights on where did I went wrong? Any help would be appreciated 🙂

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sydney20 ,

 

I suggest you to try if function to remove the repeating. My Sample is as below.

Data (2):

RicoZhou_0-1651735821474.png

Employee (1):

RicoZhou_1-1651735826238.png

Business (3):

RicoZhou_2-1651735834226.png

Relationship:

RicoZhou_4-1651735883701.png

When I use measure+0 , I will get the same result like yours. The visual will keep repeating for all employee and business units.

RicoZhou_3-1651735877640.png

Try this code.

Measure = 
VAR _COMBINE = COMBINEVALUES("-",MAX(Employee[Employee]),MAX('Business Unit'[Business Unit]))
VAR _LIST = SELECTCOLUMNS(Employee,"COMBINELIST",COMBINEVALUES("-",Employee[Employee],Employee[Business Unit]))
VAR _RESULT = CALCULATE(SUM('Table'[Value])+0,VALUES(Employee[Employee]))
RETURN
IF(_COMBINE IN _LIST, _RESULT, BLANK())

Result is as below.

RicoZhou_5-1651735974022.png

 

Best Regards,
Rico Zhou

 

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

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @sydney20 ,

 

I suggest you to try if function to remove the repeating. My Sample is as below.

Data (2):

RicoZhou_0-1651735821474.png

Employee (1):

RicoZhou_1-1651735826238.png

Business (3):

RicoZhou_2-1651735834226.png

Relationship:

RicoZhou_4-1651735883701.png

When I use measure+0 , I will get the same result like yours. The visual will keep repeating for all employee and business units.

RicoZhou_3-1651735877640.png

Try this code.

Measure = 
VAR _COMBINE = COMBINEVALUES("-",MAX(Employee[Employee]),MAX('Business Unit'[Business Unit]))
VAR _LIST = SELECTCOLUMNS(Employee,"COMBINELIST",COMBINEVALUES("-",Employee[Employee],Employee[Business Unit]))
VAR _RESULT = CALCULATE(SUM('Table'[Value])+0,VALUES(Employee[Employee]))
RETURN
IF(_COMBINE IN _LIST, _RESULT, BLANK())

Result is as below.

RicoZhou_5-1651735974022.png

 

Best Regards,
Rico Zhou

 

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

 

Thanks so much Rico!!!! 🙂 

amitchandak
Super User
Super User

@sydney20 , That is because of +0

 

In this case I have forced filter again to get only between for + 0

 

0 between range
Measure = var _1= SUM(Opportunity[Opportunity count]) +0
var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
return
CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1))

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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