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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
MadisMerk
Helper I
Helper I

Measure question

Can you help me with a measure? Let us imagine I have this table as a starting point

Vehicle number

Customer name

Vehicle type

Amount

550 RLA

Toomas

New

1

885 ASS

Toomas

Used

1

854 PPT

Toomas

New

1

754 TYU

Anne

Used

1

125 ASK

Anne

Used

1

855 ANN

Juss

New

1

999 SVE

Juss

Used

1

 

I would like to now only show the customers and the amounts for customers that have only used vehicles and no new ones. So the end result would look like this:

 

Customer name

Amount

Anne

2

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@MadisMerk 

 

Try this MEASURE

 

Measure =
IF (
    COUNTROWS ( VALUES ( TableName[Vehicle type] ) ) = 1
        && CALCULATE (
            DISTINCTCOUNT ( TableName[Vehicle type] ),
            TableName[Vehicle type] = "Used"
        ) = 1,
    COUNT ( TableName[Vehicle type] )
)

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@MadisMerk 

 

Try this MEASURE

 

Measure =
IF (
    COUNTROWS ( VALUES ( TableName[Vehicle type] ) ) = 1
        && CALCULATE (
            DISTINCTCOUNT ( TableName[Vehicle type] ),
            TableName[Vehicle type] = "Used"
        ) = 1,
    COUNT ( TableName[Vehicle type] )
)
MattAllington
Community Champion
Community Champion

It is not easy to do this with 1 table. You should load a customer dimension table too, containing all unique customers. Join this to your data table with a 1 to many relationship. Then put the customer from the customer table into the rows of a matrix. The measures would be

Total new = calculate(sum(datatable[amount]),datatable[vehicle type]=“new”)

Total but only customers with no new vehicles =calculate(sum(datatable[amount]),filter(customertable,[total new]=0))

 

i haven’t tested this, but it think it is correct. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.