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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Distinct Count based on columns

Hi Experts

 

How would you edit the following formula to count only Distinct items nested within the containsrow function...

 

OHA_OHP = CALCULATE(COUNTROWS(Data),FILTER(Data,Data[CaseType]="Face to Face"), DISTINCTCOUNT(Data[WorkType]),CONTAINSROW({"IMA OHP OffSite","OHP OnSite","IMA Network OHP","OHP Review 30 Minutes", "OHP Case Teleconference call (40 mins)"},FME_Data[WorkType]))

3 REPLIES 3
Anonymous
Not applicable

FME_Data[WorkType])) this should be Data[WorkType])) ignore.....error on my part..

Anonymous
Not applicable

Would this work..

OHA_OHP = CALCULATE(COUNTROWS(DISTINCT(Data),Data[CaseType]="Face to Face"),,CONTAINSROW({"IMA OHP OffSite","OHP OnSite","IMA Network OHP","OHP Review 30 Minutes", "OHP Case Teleconference call (40 mins)"},Data[WorkType])) ??????

Hi Route11,

 

Try DAX below and check if it can work.

OHA_OHP =
CALCULATE (
    DISTINCTCOUNT ( Data[WorkType] ),
    FILTER (
        Data,
        Data[CaseType] = "Face to Face"
            && CONTAINSROW (
                {
                    "IMA OHP OffSite",
                    "OHP OnSite",
                    "IMA Network OHP",
                    "OHP Review 30 Minutes",
                    "OHP Case Teleconference call (40 mins)" },
                FME_Data[WorkType]
            )
    )
)

Regards,

Jimmy Tao

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors