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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Emranit
Helper II
Helper II

Need a DAX where will be bulk_production count one value when production dyelot no same value

https://docs.google.com/spreadsheets/d/1valTFqJ3OU2IuiG_ErS0bM9k_QCfBFN4/edit?usp=sharing&ouid=11391... 

 

https://drive.google.com/file/d/1bApfixcHSuPBGXH8ieJo5QU88CIjiTrj/view?usp=sharing

 

Duplicate dyelot no marked with a red color, if dyelot no rows have duplicate no then bulk_production count one value and other dyelot no's bulk_production value will be 0. Like as Dyelot no 253126042 is double. Here are two bulk_productio value one is 312 & another is 213. So, one will be 312 and another will be 0. Thus, all will be same when you get duplicate dyelot no.

 

My actual data connected with SQL server. And summation of bulk_production value is more from my actual value. Bcoz there are many duplicate dyelot no.

 

1 ACCEPTED SOLUTION
V-yubandi-msft
Community Support
Community Support

Hi @Emranit  ,

Thank you for reaching out to the Microsoft Fabric community.

  • Load your data into Power BI Desktop.  We will now create a calculated column to adjust the Bulk Production values as per the required logic.
  • Go to the Modelling tab and click on New Column. Then, enter the following DAX formula for the column:

DAX:

Bulk_Production_Adjusted =

VAR CurrentDyelot = 'ProductionData'[Production Dyelot]

VAR CurrentEndTime = 'ProductionData'[EndTime]

VAR FirstOccurrence =

    CALCULATE (

        MIN('ProductionData'[EndTime]),

        FILTER (

            'ProductionData',

            'ProductionData'[Production Dyelot] = CurrentDyelot

        )

    )

RETURN

    IF (

        CurrentEndTime = FirstOccurrence,

        'ProductionData'[Bulk_Production],

        0

    )

 

  • In the Data View, examine the Bulk_Production_Adjusted column. For duplicate Production Dyelot entries, make sure only the row with the earliest EndTime retains the Bulk_Production value, while the rest should show 0.
  • In the table visual, check the Bulk_Production_Adjusted column. For Dyelot values, the row with the earliest EndTime keeps the Bulk_Production value, while the other rows display 0.

 

Output:

 

Vyubandimsft_0-1736770971244.png

 

If my answer addressed your query, kindly mark it as the Accepted Solution to assist others.

I'd also be grateful for a 'Kudos' if you found my response useful!   

 

 

 

 

 



View solution in original post

1 REPLY 1
V-yubandi-msft
Community Support
Community Support

Hi @Emranit  ,

Thank you for reaching out to the Microsoft Fabric community.

  • Load your data into Power BI Desktop.  We will now create a calculated column to adjust the Bulk Production values as per the required logic.
  • Go to the Modelling tab and click on New Column. Then, enter the following DAX formula for the column:

DAX:

Bulk_Production_Adjusted =

VAR CurrentDyelot = 'ProductionData'[Production Dyelot]

VAR CurrentEndTime = 'ProductionData'[EndTime]

VAR FirstOccurrence =

    CALCULATE (

        MIN('ProductionData'[EndTime]),

        FILTER (

            'ProductionData',

            'ProductionData'[Production Dyelot] = CurrentDyelot

        )

    )

RETURN

    IF (

        CurrentEndTime = FirstOccurrence,

        'ProductionData'[Bulk_Production],

        0

    )

 

  • In the Data View, examine the Bulk_Production_Adjusted column. For duplicate Production Dyelot entries, make sure only the row with the earliest EndTime retains the Bulk_Production value, while the rest should show 0.
  • In the table visual, check the Bulk_Production_Adjusted column. For Dyelot values, the row with the earliest EndTime keeps the Bulk_Production value, while the other rows display 0.

 

Output:

 

Vyubandimsft_0-1736770971244.png

 

If my answer addressed your query, kindly mark it as the Accepted Solution to assist others.

I'd also be grateful for a 'Kudos' if you found my response useful!   

 

 

 

 

 



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.