Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello, I explain my problem, I have a table on the canvas, which collects a number of inhabitants in 12 cities, these amounts are collected either from a What iF of each city where I manually put those records (eg Madrid: 5 hab, Barcelona: 9 hab....) or collect them from a display object called MASSFILTER that points to a table where the inhabitants are with a DNI and Name. In this MassFilter I paste for example 3 DNI's and in the table of the canvas it indicates how many inhabitants there are in each city. What I want is that if the MassFilter filter = True, that is, that I have those 3 DNI tucked in, The Table of the canvas takes me these amounts (and in the cities that there is no DNI put them blank, and if on the contrary, the MassFilter = False picks me up the amounts that are written in the What if of each city.
I detail what I have done...
The measure collected by the inhabitants of each city is this:
The measure of the number of inhabitants that it collects from another table with the MassFilter is this:
Cant DNISelec = countrows('tablaHabitantes[DNI])
In short, what I want is that in the table of the canvas I take either the number of inhabitants that I have put in the MassFilter and if it is empty that I catch those that are in each What if of each city, that is to say one or the other, and it is here where I do not find the solution, I do not know how to put within the measure Cant Habit_ the condition that if the filter is active or does not do one thing or another.
Remark: Another thing that I have seen that does not work is, if I make a HASONEFILTER on the table of inhabitants pointing to the COLUMN of DNI, this always comes out as False, although inside the MassFilter there is filtered the DNI and in the table of the canvas tell me only those 3 DNI.
Thank you very much in advance
Hi @Syndicate_Admin ,
Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.
Best Regards,
Community Support Team _ kalyj
Hi @Syndicate_Admin ,
According to your description, in my understanding, if the Cant DNISelec get a value, take it ,else if it is empty then catch those that are in each What if of each city. If this is the case, you can try this measure.
Measure =
IF (
COUNTROWS ( 'tablaHabitantes'[DNI] ) + 0 <> 0,
COUNTROWS ( 'tablaHabitantes'[DNI] ),
SWITCH (
TRUE (),
MAX ( 'Cities-Values Pant'[Cities] ) = "MADRID", SelectMadrid[Madrid Value],
MAX ( 'Cities-Values Pant'[Cities] ) = "MADRID AM", 'SelectMadrid AM'[Madrid AM Value],
MAX ( 'Cities-Values Pant'[Cities] ) = "BARCELONA", SelectBarcelona[Value Barcelona],
MAX ( 'Cities-Values Pant'[Cities] ) = "BARCELONA AM", 'SelectBarcelona AM'[Value Barcelona AM],
MAX ( 'Cities-Values Pant'[Cities] ) = "VALENCIA", 'SelectValencia'[Valencia Value],
MAX ( 'Cities-Values Pant'[Cities] ) = "SEVILLE", 'SelectSevilla'[Value SEVILLA],
MAX ( 'Cities-Values Pant'[Cities] ) = "MALAGA", 'SelectMálaga'[Malaga Value],
MAX ( 'Cities-Values Pant'[Cities] ) = "MARBELLA", 'SelectMarbella'[SelectMarbella Value],
MAX ( 'Cities-Values Pant'[Cities] ) = "CORDOBA", 'SelectCórdoba'[SelectCordoba Value],
MAX ( 'Cities-Values Pant'[Cities] ) = "GRANADA", 'SelectGranada'[Select ValueGranada],
MAX ( 'Cities-Values Pant'[Cities] ) = "BILBAO", 'SelectBilbao'[SelectBilbao Value],
MAX ( 'Cities-Values Pant'[Cities] ) = "VITORIA", 'SelectVitoria'[SelectVitoria Value],
BLANK ()
)
)
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 74 | |
| 50 | |
| 47 | |
| 44 |