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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
lucky_jyoti
Regular Visitor

Display some measures as row and some as columns in Matrix or Inforiver visual.

Hi All, 

 

I am trying to have a visual created in Inforiver/Matrix format in which my measures will be displayed as row-wise, however the YTD values for these logics should be displayed as headed in the column-wise (title). Refer to the last 2 columns in the image. 

lucky_jyoti_0-1687760271152.png

Has anyone done this before for any requirement? Need quick suggestions. 

 

 

 

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

Hi @lucky_jyoti ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1687917437577.png

Please try:

First create a new table like this:

(Create a table that has the visual column names you need and their dates)

 

Table 2 = 
var _a = SELECTCOLUMNS('Table',"YeraMonth",'Table'[YearMonth],"Date",'Table'[Date],"Sort",[Sort])
var _b = ADDCOLUMNS(FILTER(CROSSJOIN({"2022YTD","2023YTD"},SELECTCOLUMNS('Table',"Date",'Table'[Date])),YEAR([Date])=VALUE(LEFT([Value],4))),"Sort",SWITCH([Value],"2022YTD",MAX('Table'[Sort])+1,"2023YTD",MAX('Table'[Sort])+2))
return UNION(_a,_b)

 

Manage relationship:

vjianbolimsft_4-1687919055469.png

Sort by column:

vjianbolimsft_5-1687919116248.png

Then replace the visual's original Columns field 'Table'[YearMonth" with 'Table2'[YearMonth":

vjianbolimsft_3-1687918862935.png

Final output:

vjianbolimsft_6-1687919145105.png

Best Regards,

Jianbo Li

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

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @lucky_jyoti ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1687917437577.png

Please try:

First create a new table like this:

(Create a table that has the visual column names you need and their dates)

 

Table 2 = 
var _a = SELECTCOLUMNS('Table',"YeraMonth",'Table'[YearMonth],"Date",'Table'[Date],"Sort",[Sort])
var _b = ADDCOLUMNS(FILTER(CROSSJOIN({"2022YTD","2023YTD"},SELECTCOLUMNS('Table',"Date",'Table'[Date])),YEAR([Date])=VALUE(LEFT([Value],4))),"Sort",SWITCH([Value],"2022YTD",MAX('Table'[Sort])+1,"2023YTD",MAX('Table'[Sort])+2))
return UNION(_a,_b)

 

Manage relationship:

vjianbolimsft_4-1687919055469.png

Sort by column:

vjianbolimsft_5-1687919116248.png

Then replace the visual's original Columns field 'Table'[YearMonth" with 'Table2'[YearMonth":

vjianbolimsft_3-1687918862935.png

Final output:

vjianbolimsft_6-1687919145105.png

Best Regards,

Jianbo Li

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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