PowerBI – Count Dimension by other dimension linked by fact

Cheat Code
CountTargetRows = CALCULATE(
DISTINCTCOUNT(dim_TargetDimension[TheColumnName]),
FILTER(dim_middle_man, CALCULATE(sum(FT_Transaction[Cost])>0))
)

Love-Hate relationship with PowerBI!

I love the product as it’s super powerful BI tool, not to mention CHEAP (it’s free as matter of fact – PowerBI Desktop). It can do magic and wonder.

Today I was asked how to create calculation for count of dimension rows but it’s related via fact, you know… usual start schema.

Anyway after shooting couple of failed formula, I arrived at the wonderland.

Every one is happy now.

Photo by Andrea Piacquadio from Pexels

Published by Feivel

We love to travel!

Leave a comment

Design a site like this with WordPress.com
Get started