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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
VendettaBob
Helper II
Helper II

Count Filtered SUM Measure

Hi,

 

I have data in the following format:

 

Date                        Reg                     Distance Miles

20190101                Veh 1                    0

20190101                Veh 1                    0

20190101                Veh 2                     123

20190102                Veh 1                     1

20190102                Veh 1                     0

20190102                 Veh 2                   0

20190102                  Veh 3                  0

20190102                 Veh 3                   0

 

Distance Miles is already a measure. What I need to do is to Count the number of Distinct 'Reg' where the sum of the 'Distance Miles' = 0

 

So the answer above would be:

20190101     1     (Veh 1)

20190102     2     (Veh 2, Veh 3)

 

Many thanks,

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @VendettaBob 

1. Place Table1[Date] in a table visual

2. Place this measure in the visual

Measure =
SUMX ( DISTINCT ( Table1[Reg] ), INT ( [Distance Miles] = 0 ) )

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

 

Hi,

 

Thanks for this. This would work in a graph with the date on the x axis.

 

However, I also need this value in a tile. So would need to incorporate the date element into the calc. How would I do this?

 

Thanks,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.