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

View all the Fabric Data Days sessions on demand. View schedule

Reply
TheBaz_57
Frequent Visitor

From excel to PBI, how to achieve the same thing (Count cells >0)

I have an excel file which is now to big for excel that we want to migrate to PBI. But as a newbie on PBI I have no clue on how to manage something that was pretty easy in excel in PBI. 

In excel a formula allows to easily count the number of cells that contains a figure, in PBI we can't.

 

For each day, we need for each car divide the milage of each name by the number of time the car brand is used.

 

Thanks in advance for your help.

 

TheBaz_57_0-1670516670112.png

 

4 REPLIES 4
Anonymous
Not applicable

Hi @TheBaz_57 ,

 

You could create a measure to get the counting.

Count =
CALCULATE (
    COUNT ( 'Table'[Milage] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        [Car] = MAX ( 'Table'[Car] )
            && [Date] = MAX ( 'Table'[Date] )
    )
)

33.png

Then you can calcualted the divided values.

Divided =
DIVIDE ( SUM ( 'Table'[Milage] ), [Count] )

vstephenmsft_4-1670569111264.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for the reply, maybe I wrongly described what I needed.

TheBaz_57_0-1670599254606.png

Here Chevy appears 5 times.

And hence as per your calculation

TheBaz_57_1-1670599326208.png

But instead, I want that each appearance count 1. No matter is it was used several ime by same name. 

So I would need to have a total of 3 for chevy on 01/11.

I have tried several methods, with countdistinct, etc but couldn't get what I needed 😫

 

 

 

 

hi @TheBaz_57 ,

in this case try to use the measure

COUNTROWS('Table')

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mangaus1111
Solution Sage
Solution Sage

Hi @TheBaz_57 ,

you can try this measure:

DIVIDE(
   SUM('Table'[Milage]),
   CALCULATE(
             COUNTROWS('Table'),
             ALL('Table'[Name])
             )
     )

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors