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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Stanzarectah
Regular Visitor

Hide a measure in table visual using SelectedValue

Hi,

 

I am using the following measure - 'Metrics' to display in my table visual:

 

Metrics =
var Selection = SELECTEDVALUE('MeasureTable_Metrics'[Category])
RETURN
SWITCH(
TRUE(),
Selection = "Revenue|Actual", MeasureTable_PL[TotalRevenue],
Selection = "Revenue|Budget", MeasureTable_PL[TotalRevenue_Budget],
Selection = "Revenue|Difference ($)", MeasureTable_PL[TotalRevenue] - MeasureTable_PL[TotalRevenue_Budget],
Selection = "Revenue|Difference (%)", (MeasureTable_PL[TotalRevenue] - MeasureTable_PL[TotalRevenue_Budget])/MeasureTable_PL[TotalRevenue_Budget],
Selection = "Revenue|Prior Year", MeasureTable_PL[TotalRevenue_LY],
Selection = "Revenue|Prior Year|Difference ($)", MeasureTable_PL[TotalRevenue] - MeasureTable_PL[TotalRevenue_LY],
Selection = "Revenue|Prior Year|Difference (%)", (MeasureTable_PL[TotalRevenue] - MeasureTable_PL[TotalRevenue_LY])/MeasureTable_PL[TotalRevenue_LY],
Selection = "Cost of Goods Sold|Actual", MeasureTable_PL[TotalCOGS],
Selection = "Cost of Goods Sold|Budget", MeasureTable_PL[TotalCOGS_Budget],
Selection = "Cost of Goods Sold|Difference ($)", MeasureTable_PL[TotalCOGS] - MeasureTable_PL[TotalCOGS_Budget],
Selection = "Cost of Goods Sold|Difference (%)",(MeasureTable_PL[TotalCOGS] - MeasureTable_PL[TotalCOGS_Budget])/MeasureTable_PL[TotalCOGS_Budget],
Selection = "Cost of Goods Sold|Prior Year", MeasureTable_PL[TotalCOGS_LY],
Selection = "Cost of Goods Sold|Prior Year|Difference ($)", MeasureTable_PL[TotalCOGS] - MeasureTable_PL[TotalCOGS_LY],
Selection = "Cost of Goods Sold|Prior Year|Difference (%)", (MeasureTable_PL[TotalCOGS] - MeasureTable_PL[TotalCOGS_LY])/MeasureTable_PL[TotalCOGS_LY],
Selection = "Expenses|Actual", MeasureTable_PL[TotalExpense],
Selection = "Expenses|Budget", MeasureTable_PL[TotalExpense_Budget],
Selection = "Expenses|Difference ($)", MeasureTable_PL[TotalExpense] - MeasureTable_PL[TotalExpense_Budget],
Selection = "Expenses|Difference (%)", (MeasureTable_PL[TotalExpense] - MeasureTable_PL[TotalExpense_Budget])/MeasureTable_PL[TotalExpense_Budget],
Selection = "Expenses|Prior Year", MeasureTable_PL[TotalExpense_LY],
Selection = "Expenses|Prior Year|Difference ($)", MeasureTable_PL[TotalExpense] - MeasureTable_PL[TotalExpense_LY],
Selection = "Expenses|Prior Year|Difference (%)", (MeasureTable_PL[TotalExpense] - MeasureTable_PL[TotalExpense_LY])/MeasureTable_PL[TotalExpense_LY],
Selection = "Blank", 0,
0
 
All works fine however, I do not want to show the colmn 'Category' in my visual as this is used solely to determine the values for the field 'Metrics
 
Stanzarectah_0-1654755071153.png

 

When I removed the field 'Category' the measure 'Metrics' no longer calculates correctly  - this is expected behaviour as the measure used SELECTEDVALUE which is contexual (all values become 0 for the measure).

 

Is there a way to reference the Catgeory column without disaplying it on the visual and still have the measure calculate correctly?

 

Stanley 

 

 

6 REPLIES 6
Dhacd
Resolver III
Resolver III

Just checking, can you confirm whether the name and category columns are in a single table?

@Dhacd ,

 

Yes they are

Use a matrix visual and turn on the stepped layout and in the row headers turn off +/- icon this is the closest we can do I believe.

Unfortunbately this doesn't solve my issue. I get he following:

 

Stanzarectah_0-1654779175539.png

 

rajulshah
Resident Rockstar
Resident Rockstar

Hello @Stanzarectah ,

 

You can change the color of rows to any one color, let's say, white.

Then change the font color of both the values and the title to white.

 

Maybe this can be nearer to hiding the column as there is no feature present in Power BI now.

Yes, I have tried that a as a work around but was wondering if there is another way.

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors