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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Super User
Super User

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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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