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
Boe
Frequent Visitor

Distinct Sum based on Another Column

Hi,We are trying to Sum our min value column based on disticnt values from Malzeme Column.But we have additional filters that we need for our calculation.

Our code is goes as follows;

Min value, hammadde bazında =
VAR mySymbol = 'VA05-Açık Sipariş'[Hammadde / Çap]
VAR duedate=TODAY()

VAR myFilter = FILTER(
            'VA05-Açık Sipariş',
            'VA05-Açık Sipariş'[Hammadde / Çap] = mySymbol && 'VA05-Açık Sipariş'[30 Gün önceki Tarih Bilgisi]<=duedate && 'VA05-Açık Sipariş'[mın value]<0
           
           
     
           
           

            )

RETURN
   CALCULATE(SUMX(myFilter,'VA05-Açık Sipariş'[mın value]),ALLEXCEPT('VA05-Açık Sipariş','VA05-Açık Sipariş'[Malzeme]))
 
And using this function according to  our sample data we have the result of -18,209.However the real result is -11.18
I hope you can help.
Our Sample Data as follows;
Malzeme30 Gün önceki Tarih Bilgisimın valueMin value, hammadde bazında
400099720 Mar 2022-0,20679-18,2091
400099711 Ara 2022-0,20679-18,2091
400100511 Eki 20220,002378-18,2091
400099720 Mar 2020-0,20679-18,2091
40009702 May 2022-0,0002-18,2091
400096626 Ağu 2022-0,94448-18,2091
40009732 May 20220,715661-18,2091
400097326 Ağu 20220,715661-18,2091
40009662 May 2022-0,94448-18,2091
400097026 Ağu 2022-0,0002-18,2091
40444922 Oca 2023 -18,2091
406345217 Kas 2022-0,46031-18,2091
40223887 Haz 2022-2,39412-18,2091
40211067 Haz 2022-1,05643-18,2091
40215337 Haz 2022-2,73499-18,2091
40212147 Haz 2022-0,53798-18,2091
406687430 Kas 2022-0,01521-18,2091
406459118 Eki 2022-2,82837-18,2091
406459129 Oca 2023-2,82837-18,2091
406459129 Oca 2023-2,82837-18,2091
406459119 Ara 2022-2,82837-18,2091
406459118 Eki 2022-2,82837-18,2091
400012730 Ara 202248,13617-18,2091
40001276 Ara 202248,13617-18,2091
400012711 Kas 202248,13617-18,2091
400012711 Kas 202248,13617-18,2091
400012721 Ara 202248,13617-18,2091
406459123 Eki 2022-2,82837-18,2091
406459119 Ara 2022-2,82837-18,2091
406459319 Ara 20220,20919-18,2091
406459329 Oca 20230,20919-18,2091
406459318 Eki 20220,20919-18,2091
400013721 Ara 20220,21639-18,2091
400013711 Kas 20220,21639-18,2091
406459319 Ara 20220,20919-18,2091
406474019 Ara 2022 -18,2091
406474019 Ara 2022 -18,2091
406687417 Kas 2022-0,01521-18,2091
40001276 Ara 202248,13617-18,2091
400012730 Kas 202248,13617-18,2091
40001276 Ara 202248,13617-18,2091
40001376 Ara 20220,21639-18,2091
400012717 Kas 202248,13617-18,2091
1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @Boe,

It sounds like a common multiple aggregation calculate on measures formula(sum min value abased on category group), you can try to use the following measure formula if it suitable for your requirement:

Min value, hammadde bazında =
VAR mySymbol = 'VA05-Açık Sipariş'[Hammadde / Çap]
VAR summary =
    SUMMARIZE (
        FILTER (
            ALLSELECTED ( 'VA05-Açık Sipariş' ),
            'VA05-Açık Sipariş'[Hammadde / Çap] = mySymbol
                && 'VA05-Açık Sipariş'[30 Gün önceki Tarih Bilgisi] <= TODAY ()
                && 'VA05-Açık Sipariş'[mın value] < 0
        ),
        [Malzeme],
        "_Min", MIN ( 'VA05-Açık Sipariş'[mın value] )
    )
RETURN
    SUMX ( summary, [_Min] )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @Boe,

It sounds like a common multiple aggregation calculate on measures formula(sum min value abased on category group), you can try to use the following measure formula if it suitable for your requirement:

Min value, hammadde bazında =
VAR mySymbol = 'VA05-Açık Sipariş'[Hammadde / Çap]
VAR summary =
    SUMMARIZE (
        FILTER (
            ALLSELECTED ( 'VA05-Açık Sipariş' ),
            'VA05-Açık Sipariş'[Hammadde / Çap] = mySymbol
                && 'VA05-Açık Sipariş'[30 Gün önceki Tarih Bilgisi] <= TODAY ()
                && 'VA05-Açık Sipariş'[mın value] < 0
        ),
        [Malzeme],
        "_Min", MIN ( 'VA05-Açık Sipariş'[mın value] )
    )
RETURN
    SUMX ( summary, [_Min] )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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