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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Dax If statement. I am trying to convert a formular from Tableau to Power BI.

 

Tableau formular:

IF [Unit Nbr] = [Cost Ctr Nbr] then 'DRIVE Unit' else 'Non DRIVE' END

 

Power Bi Dax formular: 

 

Drive Unit = If('AP Paid unit detail'[UNIT_NBR]='Drive_In_Scope_Unit_List'[Cost Ctr Nbr], "Drive Unit", "Non Drive Unit")

 

The problem is " A single value for column 'Cost Ctr Nbr' in table 'Drive_In_Scope_Unit_List' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count....."

 

How can i fix this? 

 

Thank you so much 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Assume you have tables

Capture8.JPG

You could create a column/ measure in "AP Paid unit detail" table

Column =
VAR lookvalue =
    LOOKUPVALUE (
        Drive_In_Scope_Unit_List[Cost Ctr Nbr],
        Drive_In_Scope_Unit_List[Cost Ctr Nbr], 'AP Paid unit detail'[UNIT_NBR]
    )
RETURN
    IF ( lookvalue = BLANK (), "Non DRIVE", "DRIVE Unit" )

Measure =
VAR lookvalue =
    LOOKUPVALUE (
        Drive_In_Scope_Unit_List[Cost Ctr Nbr],
        Drive_In_Scope_Unit_List[Cost Ctr Nbr], MAX ( 'AP Paid unit detail'[UNIT_NBR] )
    )
RETURN
    IF ( lookvalue = BLANK (), "Non DRIVE", "DRIVE Unit" )

Capture9.JPGCapture10.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Assume you have tables

Capture8.JPG

You could create a column/ measure in "AP Paid unit detail" table

Column =
VAR lookvalue =
    LOOKUPVALUE (
        Drive_In_Scope_Unit_List[Cost Ctr Nbr],
        Drive_In_Scope_Unit_List[Cost Ctr Nbr], 'AP Paid unit detail'[UNIT_NBR]
    )
RETURN
    IF ( lookvalue = BLANK (), "Non DRIVE", "DRIVE Unit" )

Measure =
VAR lookvalue =
    LOOKUPVALUE (
        Drive_In_Scope_Unit_List[Cost Ctr Nbr],
        Drive_In_Scope_Unit_List[Cost Ctr Nbr], MAX ( 'AP Paid unit detail'[UNIT_NBR] )
    )
RETURN
    IF ( lookvalue = BLANK (), "Non DRIVE", "DRIVE Unit" )

Capture9.JPGCapture10.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Tahreem24
Super User
Super User

Try to use below measure:
Drive Unit = If(Sum('AP Paid unit detail'[UNIT_NBR]) =Sum('Drive_In_Scope_Unit_List'[Cost Ctr Nbr]) , "Drive Unit", "Non Drive Unit")

Please hit Thumbs up and mark it as a solution if it helps you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
az38
Community Champion
Community Champion

Hi @Anonymous 

it looks like are trying to create measure, but you need a calculated column

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

So how can i do that?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors