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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
jeanL
Frequent Visitor

Display card based on measure and filter

I have created a measure to calculate the percentage of the amount by the total (filtered by main services)

My measure calculation is as follow

 

% teu by service = 
VAR teu = CALCULATE( SUM(summary_table[Total TEUs]))
VAR t_total =
    CALCULATE(
        CALCULATE( SUM(summary_table[Total TEUs])),
        ALLSELECTED( summary_table[control_party_name]))
VAR result = DIVIDE(teu , t_total)
RETURN
    result

 

 

While at the same time, the report has several filters, in customer segment, main services and control party name. 

In this case, the above only returns % over the total by main service. 

 

However i would like the option to be able to select the control party name, in which a card would display the respective % exposure.


The rows below is by control party name. So example if i select the control party name of the first row, example A, it would show 67% on the card instead of the 100% and B would return 18%. 

 

type.PNG

2 REPLIES 2
amitchandak
Super User
Super User

@jeanL , Please use an independent table control_party_name  slicer

 

% teu by service =
var _control_party_name = allselected(control_party_name[control_party_name])
VAR teu = CALCULATE( SUM(summary_table[Total TEUs]))
VAR t_total =
CALCULATE(
CALCULATE( SUM(summary_table[Total TEUs])),
filter(summary_table, summary_table[control_party_name] =_control_party_name ))
VAR result = DIVIDE(teu , t_total)
RETURN
result

 

refer

Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi @amitchandak 

 

I receive the error as such. 

A table of multiple values was supplied where a single value was expected.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

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.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.