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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Matrix chart - show value once time

I have a table F_MK with columns: ID, MKID, Dep, Tres. I also have a table F_Re with columns: ID, MKID, and Ac (General Number type). Both tables share the MKID column, and the ID columns in both tables have relationships with the Dim_Pl table, which has columns: ID and Name.

Now, I want to create a matrix where:

  • Rows: MKID, Dep, Tres from the F_MK table.
  • Columns: Name from the Dim_Pl table.
  • Values: The sum of the Ac column from the F_Re table.

 

I created a measure as follows:
Total Ac = SUMX( VALUES(Dim_Pl[ID]), CALCULATE( SUM(F_Re[Ac]), TREATAS(VALUES(F_MK[MKID]), F_Re[MKID]) ) )
After creating the measure, the matrix will look like this:

Tram8286_1-1737539300239.png

 


But I want like this :

Tram8286_2-1737539300240.png

 

What I want is for each MKID, the values should only appear once (since the values are the result of the sum for a single MKID). However, right now, the values are getting duplicated. 

4 REPLIES 4
danextian
Super User
Super User

Hi @Anonymous 

 

It looks like you are trying to create a calculated column and not a measure. And the reason the values repeat is because the filter is on MKID only and all other columns are excluded.

 

try:

SUMX (
    // Filter rows in table1
    FILTER (
        table1,
        // Condition 1: Matching MKID value from table2
        table1[MKID]
            = EARLIER ( table2[MKID] ) // Condition 2: Matching Dep value from table2
            && table1[Dep] = EARLIER ( table2[Dep] ) // Condition 3: Matching ID value from table2
            && table1[ID] = EARLIER ( table2[ID] ) // Condition 4: Matching Tres value from table2
            && table1[Tres] = EARLIER ( table2[Tres] )
    ),
    // Sum the [Value] column for the filtered rows
    [Value]
)

Table2 is where will be createing this calculated column.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi danextian, Thank you for your appreciate time . I don't understand Table 1 and table 2 is what you mean. Two pictures that I post is I assume that the Matrix chart that I want to create. Information about the table is here:
"

I have a table F_MK with columns: ID, MKID, Dep, Tres. I also have a table F_Re with columns: ID, MKID, and Ac (General Number type). Both tables share the MKID column, and the ID columns in both tables have relationships with the Dim_Pl table, which has columns: ID and Name.

Now, I want to create a matrix where:

  • Rows: MKID, Dep, Tres from the F_MK table.
  • Columns: Name from the Dim_Pl table.
  • Values: The sum of the Ac column from the F_Re table."

Thank you.



I was referring to this table for Table2. This is where you will create the calculated column. Table1 is the other fact table.

danextian_0-1737606988541.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

No, I mean Table 2 and Tabe 1 is not a table , its is the Matrix CHART  I want to create, Table 2 is Matrix CHART that I want to create like this.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.