TOTAL for grouping data by using different filter  [Solved]

Anything related to PowerPivot and DAX Formuale
tomlei
Posts: 4
Joined: Sun Mar 01, 2020 7:04 pm

TOTAL for grouping data by using different filter

Postby tomlei » Sat Jan 16, 2021 5:31 pm

I will try to explain the scope:

Within BI I want to calculate the TOTAL loss in kg for different types of defects over a certain time range by grouping the data for the same scrap plate and selecting the highest defect class.

In detail:
- I have a list of scraped plates with the related defects (classes and types)
- it could be that one scrap plate with the plate ID is more than one times in the list, because there are different defect types and/or classes on it
- I need to select the highest defect class on each plate
- I need the TOTAL loss in kg for each defect type over the time period
- I want to visualize these TOTAL numbers in a pareto chart

I calculate a sample data by using excel - please see the attachment.

If someone able to help me with that?
Attachments
scrapDefects_2021-01-16-1.xlsx
(22.27 KiB) Downloaded 11 times

tomlei
Posts: 4
Joined: Sun Mar 01, 2020 7:04 pm

Re: TOTAL for grouping data by using different filter

Postby tomlei » Sun Jan 17, 2021 8:29 pm

Hello All
let me rephrase it in the 2nd version - see attachment

Regards
Tom
Attachments
scrapDefects_2ndVersion.xlsx
(10.2 KiB) Downloaded 11 times

rwfigtree
Posts: 22
Joined: Tue Jan 05, 2021 8:49 pm
Location: Sydney, Australia

Re: TOTAL for grouping data by using different filter  [Solved]

Postby rwfigtree » Mon Jan 18, 2021 5:27 pm

m:=var x = SUMMARIZE(Table2,Table2[Tab1_ID],"avg",AVERAGE(Table1[f2]))
return SUMx(x,[avg])

tomlei
Posts: 4
Joined: Sun Mar 01, 2020 7:04 pm

Re: TOTAL for grouping data by using different filter

Postby tomlei » Sun Jan 24, 2021 4:08 pm

rwfigtree {L_WROTE}{L_COLON}m:=var x = SUMMARIZE(Table2,Table2[Tab1_ID],"avg",AVERAGE(Table1[f2]))
return SUMx(x,[avg])


Today, I was able to check the forum and I have used your measure - it works !! Many thanks. But, I am still struggling to understand what happened there... :-)

Here the measure and attached the chart result.

{L_CODE}{L_COLON} {L_SELECT_ALL_CODE}

xm_GBDefGrp_2 =
VAR _x = SUMMARIZE(Tab_GB_GTCDefects,Tab_GB_GTCDefects[GTCDefect_GTCRowID],"avg",AVERAGE(Tab_GB_GTCDist[x_WeightSqmTotal]))
return
SUMX(_x,[avg])

chart_DefectLosses.JPG
chart_DefectLosses.JPG (14.82 KiB) Viewed 494 times

table_DefectLosses.JPG
table_DefectLosses.JPG (16.03 KiB) Viewed 489 times


Do you have an idea how I can create a Pareto Chart from the data? Maybe you can help me with that too. I did it with Rank in another case, but I dont knwo how can I get the measure result in a table to add the Rank column for the pareto function/chart.

thanks and regards
Tom

rwfigtree
Posts: 22
Joined: Tue Jan 05, 2021 8:49 pm
Location: Sydney, Australia

Re: TOTAL for grouping data by using different filter

Postby rwfigtree » Mon Jan 25, 2021 3:10 pm

Hi just been mucking around with some ideas not fully there but you might be able to take it from here or someone else can put in 2 cents.

Changed original formula to something a little simpler.

mResult:=var x = VALUES(Table2[Tab1_ID])
return CALCULATE(SUM(Table1[f2]),FILTER(Table1,CONTAINSROW(x,Table1[IDTab1])))

Also might need to use calculated columns to do the chart, but was getting stuck with circular references when doing the ranking. So fun times for you.

Be interested if you come up with solution please post.

See attached.
Attachments
kek2.xlsx
(222.33 KiB) Downloaded 9 times

rwfigtree
Posts: 22
Joined: Tue Jan 05, 2021 8:49 pm
Location: Sydney, Australia

Re: TOTAL for grouping data by using different filter

Postby rwfigtree » Mon Jan 25, 2021 3:18 pm

Always been a bit interested in material sciences, did civil engineering at uni a zillion years ago.
Who do you work for if you don't mind me asking.

tomlei
Posts: 4
Joined: Sun Mar 01, 2020 7:04 pm

Re: TOTAL for grouping data by using different filter

Postby tomlei » Sat Jan 30, 2021 2:37 pm

rwfigtree {L_WROTE}{L_COLON}Always been a bit interested in material sciences, did civil engineering at uni a zillion years ago.
Who do you work for if you don't mind me asking.


Hello and sorry for my late response, in the meantime I was trying to find a solution for the Pareto topic - without success so far.
Regarding your question about my work, I am working for a glass maker. We are producing float glass in Europe. The defects I am analyzing are standard melting defects in the melting process.

regards
Tom


Return to “PowerPivot/DAX”

Who is online

Users browsing this forum: No registered users and 6 guests