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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX to return true if our plant makes the sku or not.

Hello,

 

I have the following command in tableau:

(Fixed product_name: sum(IF [site_id] = "001" THEN [sale_unit] END))

 

I am trying to do something similar in power BI where I can recognize what product_names are made in our plant and sum the sale_units by matching it to our site_id.

 

Any idea on how I can achieve this?

 

Thanks in advance for your help!

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

And incase you only want for site id 001.

 

Measure =
CALCULATE (
    SUM ( Table[Salesunit] ),
    Table[Siteid] = "001"
)

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

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

 

View solution in original post

4 REPLIES 4
harshnathani
Community Champion
Community Champion

HI @Anonymous ,

 

 

Try a measure like this

 

 

Measure =
CALCULATE (
    SUM ( Table[Salesunit] ),
    ALLEXCEPT (
        Table,
        Table[site_id]
    )
)

 

 

Regards,


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

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

Hi @Anonymous ,

 

And incase you only want for site id 001.

 

Measure =
CALCULATE (
    SUM ( Table[Salesunit] ),
    Table[Siteid] = "001"
)

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

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

 

Anonymous
Not applicable

@harshnathani I know it has been a while since this post, but do you know how we could to the flip of this. I want to see what our plant sends to other plants and see whether the site we send it to has the capability to make that sku.

 

I tried doing the flip of what we initially had for our home site with this:

_Site Produces = CALCULATE ( SUM ( 'table'[sales_unit] ), ALLEXCEPT('table','table'[prod_name]), 'table'[site_code] = "011", 'table'[site_code] = "018", 'table'[site_code] = "019", 'table'[site_code] = "020", 'table'[site_code] = "065") 

 

I then created a conditional statement to check for T/F condition of production.

_Site Produces(T/F) = if([_Site Produces] <> 0, "True","False")

 

This however, is always giving me all false, dispite there being cases where it should be true. Is there anything I may be missing?

 

Thanks!

Anonymous
Not applicable

@harshnathani Exactly what I needed, thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors