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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
slipstream
New Member

Measure formula help

Hi

 

Im trying to create a measure to count the total unique records where template starts with AB-

 

uniquetemplatedate
   
abcAB-123Jan-19
abcdAB-124Feb-19
abcdeFG-12Jan-19
abcdeDG-12Jan-19
abc1AB-123Feb-19
abcd2FG-12Jan-19
abcd3AB-124Jan-19
abcde4HG1Feb-19
af12AB-125Jan-19

 

Measure 1 =
CALCULATE(
COUNT('Records'[Column.unique])
,FILTER(
('Records'),
LEFT('Records'[Column.template],3) = "AB-"
)
)

 

I have tried this but instead of returning 5 (as in 5 unique records that start with AB-) it returns 3 (as there are 3 different records in templates that start with AB)

 

any ideas please ?

many thanks

jason

 

1 ACCEPTED SOLUTION
vanessafvg
Community Champion
Community Champion

@slipstream 

 

hi thats is quite strange, ive added your data to a model and run your calculation and i get 5, can you share your pbix?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
PattemManohar
Community Champion
Community Champion

@slipstream  Your Measure logic is returning 5 as well, not sure why it is 3 at your end ?

 

Please try this as a New Measure... 

 

Test238 = COUNTROWS(FILTER(Test238Measure,LEFT(Test238Measure[Template],3)="AB-"))

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




apologies all, seems it was working, just my ability to type wasnt ! 🙂

 

thank you all for your help

cheers

vanessafvg
Community Champion
Community Champion

@slipstream 

 

hi thats is quite strange, ive added your data to a model and run your calculation and i get 5, can you share your pbix?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.