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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Keza
New Member

Help with Conditional Statement in PowerBI

vin.JPGHello, 

 

I am a newbie with PowerBi, I only know basic data visualisation so far. I would like to set/write a conditional statement (not sure if i am using the right terms) correct me if i am not please:)

 

I have two columns i want to focus on, VIN column and Base DTC column. The VIN column shows the Vehicle Identity number which is however, duplicated. The Base DTC column shows the error codes in the particular VIN. Some VINs have more than one error code hence the row duplication. I would like to create a count of the number of VINs based on the error code. eg VIN 99JCA2N0LT208770 has two error codes (seen in Base DTC column), if i select both those error codes in the slicer, I expect it to show me the number of VINs when only those two errors are in the same VIN (therefore result should be 1) but instead it gives me a row count and returns result as "2". Please help me. I am really stuck. Please see attached screenshot: 

 
 

 

Many thanks 

Keza 

4 REPLIES 4
onlinelearning
New Member

Hi Keza - 

 

Do you have a sample file you can share for this please? I'd like to know what visual you were using and if at all there is a measure created as well?

 

Regards

E

Hello E,

 

how can i attach it on here? I dont see an option..

 

regards,

Martha

Anonymous
Not applicable

Hi @Keza ,

You can upload your sample file to OneDrive for Business, then share the link with us.

Please check if the below screen shot is your desired result? If yes, just drag the field VIN with aggregation "Count(Distinct)" onto Card visual.

distinct count.jpg

Best Regards

Rena

Greg_Deckler
Community Champion
Community Champion

Oh, you have actually stumbled across a really hard problem. You want an AND slicer and those used to be a myth. Luckily, they have since been figured out. https://community.powerbi.com/t5/Quick-Measures-Gallery/Patient-Cohort-AND-Slicer/m-p/391883#M130



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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