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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

I need a Measure that adds up the total of a column of a Table viewer object

Hello, thank goodness there is this forum, I am a beginner and without your answers I would be very lost.

I'm stuck on the following:

I have 3 what if from three cities where manually the user types the number of inhabitants of each city, these amounts are dumped into a table visual. Apart from these amounts I have added another measure where it is calculated, on the amounts that have been manually put 8% more. My problem is that this table does not add up the totals, nor those that are entered manually nor the column that I have added, and I need measurements that calculate the totals. Please Could you help me?

I put the two measures I have and a screen print so that you have the maximum information:

Measure of Number of Inhabitants:

Number of Inhabitants =

Switch(true() ,

Max('Ciudades-Valores Pant'[Ciudades])="MADRID",SelectMadrid[Valor Madrid],
Max('Ciudades-Valores Pant'[Ciudades])="BARCELONA",SelectBarcelona[Valor Barcelona],
Max('Ciudades-Valores Pant'[Ciudades])="SEVILLA",'SelectSevilla'[Valor SEVILLA],
BLANK()
)

Measure Population inhabitants 8%+

Estimated population 8% =

sum('Digital Table Habit and Cities'[Number of Inhabitants])*(1+0.08%)

)

JaviBI_0-1653925730145.png

And as always thank you very much for your help

Greetings

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @JaviBI 

 

You can try these measures

Number of Inhabitants = 
SWITCH(TRUE() ,
SELECTEDVALUE('Ciudades-Valores Pant'[Ciudades])="MADRID",[MADRID Value],
SELECTEDVALUE('Ciudades-Valores Pant'[Ciudades])="BARCELONA",[BARCELONA Value],
SELECTEDVALUE('Ciudades-Valores Pant'[Ciudades])="SEVILLA",[SEVILLA Value],
[MADRID Value]+[BARCELONA Value]+[SEVILLA Value]
)
Estimated population 8% = [Number of Inhabitants] * (1+0.08)

vjingzhang_0-1654155282332.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @JaviBI 

 

You can try these measures

Number of Inhabitants = 
SWITCH(TRUE() ,
SELECTEDVALUE('Ciudades-Valores Pant'[Ciudades])="MADRID",[MADRID Value],
SELECTEDVALUE('Ciudades-Valores Pant'[Ciudades])="BARCELONA",[BARCELONA Value],
SELECTEDVALUE('Ciudades-Valores Pant'[Ciudades])="SEVILLA",[SEVILLA Value],
[MADRID Value]+[BARCELONA Value]+[SEVILLA Value]
)
Estimated population 8% = [Number of Inhabitants] * (1+0.08)

vjingzhang_0-1654155282332.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

amitchandak
Super User
Super User

@Syndicate_Admin , Try a measure like

 

Estimated population 8% =

sumX(Values('Ciudades-Valores Pant'[Ciudades]),('Digital Table Habit and Cities'[Number of Inhabitants])*(1+0.08%))

Hello, at first I saw the structure and I thought it was fine, but when it comes to applying it in the power bi report I am not able to adapt it. I tell you, I do not know where the measure of "Values" comes from, in my explanation there is nothing about it. the values of the cities come from the What if parameters.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.