Maybe there is a better way to do it?
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
I've created three tables. Structure on screen.
Relationships:
DimPowerPlant(Id)(1) - (1)FactNuclearPowerPlant(Id)
DimCountryCode(Id)(1) - (*)FactNuclearPowerPlant(CountryNumericCode)
I've created Matrix visual. In rows, I put DimCountryCode(CountryName) and DimPowerPlant(ReactorType). As values I wanted to show occurences for every country in groups and subgroups. Like bellow - Total05 measure:
At first I had written this code.
Total02 = CALCULATE(COUNTROWS(FactNuclearPowerPlant);ALLEXCEPT(DimCountryCode;DimCountryCode[CountryName]))
But it doesnt't work properly. It works when all the data are in one table.
So, I've created this measure:
Total05 = CALCULATE(COUNTROWS(FactNuclearPowerPlant);FILTER(ALLEXCEPT(FactNuclearPowerPlant;DimCountryCode[CountryName]);COUNTROWS(FactNuclearPowerPlant) <> BLANK()))
It works well, but I can't understand how this piece of code works and why Total02 measure doesn't work correctly in this case.
FILTER(ALLEXCEPT(FactNuclearPowerPlant;DimCountryCode[CountryName]);COUNTROWS(FactNuclearPowerPlant) <> BLANK())
Maybe there is a better way to do it?
Solved! Go to Solution.
Hi @Anonymous ,
As the measure total02, the column DimCountryCode[CountryName] is used to the visual, the results are different. Because DimCountryCode is specified as the argument to ALLEXCEPT, when the data is filtered, a filter will be applied on country at the row level, as shown in your table visual.
Regards,
Frank
Hi @Anonymous ,
As the measure total02, the column DimCountryCode[CountryName] is used to the visual, the results are different. Because DimCountryCode is specified as the argument to ALLEXCEPT, when the data is filtered, a filter will be applied on country at the row level, as shown in your table visual.
Regards,
Frank
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!