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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
wladi
New Member

Sum based on calculation groups and multiple filter selection

Hello guys,

I have created a calculation group with a logic of dynamic calculation for ABC classification with follow RETURN:

 

...

VAR Tab_ABCTabInArtikel =
    FILTER(
        CROSSJOIN(
            Tab_KumProzent,
            ABC_Tab
        ),
        AND(
            [@KumProzent] > ABC_Tab[ABC_Untergrenze],
            [@KumProzent] <= ABC_Tab[Obergrenze]
        )
       
    )

RETURN
    CALCULATE(
        SELECTEDMEASURE(),
        KEEPFILTERS(Tab_ABCTabInArtikel)
    )
 
Now I try to calculate the target inventory value according to parameters (sliser)wladi_0-1712064131395.png

I have create follow measure:

VAR ABCKlasse = SELECTEDVALUE(ABC_Tab[ABC])
VAR Verbrauchsdauer =
    INT(
        (CALCULATE(
        MAX(Artikelposten[Buchungsdatum]) - MIN(Artikelposten[Buchungsdatum]),
        ALL(Artikelposten)
        ) + 1)
        / 7 * 5
    )

VAR Result =
SWITCH(TRUE(),
        ABCKlasse = "A", DIVIDE([hm_Verbrauchswert], Verbrauchsdauer) * AX[AX-Wert],
        ABCKlasse = "B", DIVIDE([hm_Verbrauchswert], Verbrauchsdauer) * BX[BX-Wert],
        ABCKlasse = "C", DIVIDE([hm_Verbrauchswert], Verbrauchsdauer) * CX[CX-Wert],
        ABCKlasse = "N", [hm_Bestandswert] / 100 * (100 - 'Potenzial ND %'[Potenzial ND %-Wert])
    )

RETURN
Result
 
Now it works best in a bar chart, but the table doesn't show the sum of the measure 'target inventory':
wladi_1-1712064429530.png

The card visual shows sum if only one value of ABC-filter is selected. But by more as one selected

value, the card visual shows now sum calculation:

wladi_2-1712064764723.png

I hope you can help me!

 
5 REPLIES 5
wladi
New Member

I have solved my problem where I used the join table for sumx() funktion in RETURN of calculation group:

wladi_1-1712324479612.png

But now, if I want to calculate simple calculation by using of calculation groups as filter, I get crazy result 😂

wladi_2-1712324736382.png

 

 

Hi, @wladi 

Thank you very much for your reply and at the same time thank you for sharing the solution. As for this calculation group being used as a filter causing the result to be incorrect, I guess it might be related to your external context.

vjianpengmsft_0-1712548068011.png

 

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

wladi
New Member

Hi Jianpeng,

thank you for your suggestion.

Unfortunately I can not use column calculation because the ABC-Calculation should be carried out dynamically.

For this I have added the calculation group to the page filter:

wladi_0-1712126263443.png

How can I attach the PBI file with sample data? 

wladi_1-1712128843717.png

 

Hi, @wladi 

Thank you very much for your reply. You can share your PBIX files via Google drive or SharePoint. Please be careful not to include private data. When you use Google Drive, set up anonymous verification.


Best Regards

Jianpeng Li

v-jianpeng-msft
Community Support
Community Support

Hi, @wladi 

I'm trying to create a scenario similar to yours as shown in the image below:

vjianpengmsft_0-1712122043784.png

If you need to show totals for this column, you can do it in a few ways:

Method one, establish a measure for this column:

vjianpengmsft_1-1712122199085.png

Method 2, set this column to sum:

vjianpengmsft_2-1712122241465.png

Method 3, you can use the ISINSCOPE method to tell if the current row is a total row, and if so, then sum.

vjianpengmsft_3-1712122829416.png

vjianpengmsft_4-1712122868425.png

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.