Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
first timer. I am trying to do what feels like a simple aggregation. I have a list of customers and their distance to candy stores. I want to summarize the number of customers by their distance to the closest store.
in SQL it looks like this:
Solved! Go to Solution.
A measure solution.
Cust Count by Min Miles =
VAR _milesInFilterContext = VALUES( Table1[Miles Away] )
RETURN
COUNTX(
VALUES( Table1[customerID] ),
VAR _minMileByCust = CALCULATE( MIN( Table1[Miles Away] ), ALL( Table1[Miles Away] ) )
RETURN
IF( _minMileByCust IN _milesInFilterContext, 0 )
)
Formatting: continuous x-axis with title/value labels off + custom format data labels
A measure solution.
Cust Count by Min Miles =
VAR _milesInFilterContext = VALUES( Table1[Miles Away] )
RETURN
COUNTX(
VALUES( Table1[customerID] ),
VAR _minMileByCust = CALCULATE( MIN( Table1[Miles Away] ), ALL( Table1[Miles Away] ) )
RETURN
IF( _minMileByCust IN _milesInFilterContext, 0 )
)
Formatting: continuous x-axis with title/value labels off + custom format data labels
YEP. SAVED MY WEEKEND. TYFYS MARK.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 37 | |
| 28 | |
| 27 |