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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
agram
Frequent Visitor

Hardcode Custom Row in PowerBI Matrix

Hi all, so I have a matrix in PowerBI that looks as follows: 

agram_0-1723042107195.png

I am wondering if it possible to create a custom row in the top row of the table that would look something like this: 

agram_1-1723042314656.png

The Budget and Forecast exist in my data currently but the only way I have found to add them adds them as another column rather tahn another row on top of the data which is what I am after. I am wondering if it is possible to link my data into a custom row like this and if not is there a possibility to just hardcode the data in and I can enter it myself.

 

1 ACCEPTED SOLUTION
v-xingshen-msft
Community Support
Community Support

Hi All
Firstly Greg_Deckler thank you for your solution!
And @agram ,after all this time, have you solved the problem you are experiencing, if you are still experiencing problems with the new table, I have written the DAX based on your example data, I hope it can help you! 

NewTable = 
UNION(
    SELECTCOLUMNS(
        'Table',
        "Month", [Month],
        "Week", [Week],
        "# day", [# day],
        "COND Ratio", [COND Ratio],
        "FIELD", [FIELD]
    ),
    ROW(
        "Month", "April",
        "Week", "Budget",
        "# day", BLANK(),
        "COND Ratio", 15,  
        "FIELD", 20 
    ),
    ROW(
        "Month", "April",
        "Week", "Forecast",
        "# day", BLANK(),
        "COND Ratio", 16,  
        "FIELD", 21 
    )

)

vxingshenmsft_0-1724142550268.png

If you have any other questions, you can check out the PBIX file I uploaded, and I'd be honoured if my answer solves your problem!

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

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

4 REPLIES 4
v-xingshen-msft
Community Support
Community Support

Hi All
Firstly Greg_Deckler thank you for your solution!
And @agram ,after all this time, have you solved the problem you are experiencing, if you are still experiencing problems with the new table, I have written the DAX based on your example data, I hope it can help you! 

NewTable = 
UNION(
    SELECTCOLUMNS(
        'Table',
        "Month", [Month],
        "Week", [Week],
        "# day", [# day],
        "COND Ratio", [COND Ratio],
        "FIELD", [FIELD]
    ),
    ROW(
        "Month", "April",
        "Week", "Budget",
        "# day", BLANK(),
        "COND Ratio", 15,  
        "FIELD", 20 
    ),
    ROW(
        "Month", "April",
        "Week", "Forecast",
        "# day", BLANK(),
        "COND Ratio", 16,  
        "FIELD", 21 
    )

)

vxingshenmsft_0-1724142550268.png

If you have any other questions, you can check out the PBIX file I uploaded, and I'd be honoured if my answer solves your problem!

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

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

Greg_Deckler
Super User
Super User

@agram Well, there's a way but it's really ugly. The New Hotness (Custom Matrix Hierarchy) - Microsoft Fabric Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Just read your write up.. Looks exactly like what I am looking for! Just wondering though, in your write up you create new columns, how am I able to create new rows with a hierarchy?

@agram It should be the same technique but you would use the disconnected table for the rows instead of the columns. Or, you may have to use a disconnected table for both the rows and the columns. If you post sample data as text I might have time to look at it more in-depth.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.