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
Yonah
Helper II
Helper II

Summary and Addcolumns

Hi,
i'm working on a somewhat komplikatet problem in PowerBI/DAX.
I have one Tablle how has a countetn like this:
This table was created by union from 4 individual tables.

DateArticle numberQuantityQuantity greater than 0Quantity greater than 1Quantity greater than 2Quantity greater than 3Year
01.05.201911TRUEFALSEFALSEFALSE2019
02.05.201924TRUETRUETRUETRUE2019
03.05.201935TRUETRUETRUETRUE2019
04.05.201916TRUETRUETRUETRUE2019
05.05.201927TRUETRUETRUETRUE2019
06.05.201938TRUETRUETRUETRUE2019
07.05.201912TRUETRUEFALSEFALSE2019
08.05.201922TRUETRUEFALSEFALSE2019
09.05.201933TRUETRUETRUEFALSE2019
10.05.201916TRUETRUETRUETRUE2019
20.03.202029TRUETRUETRUETRUE2020
21.03.202032TRUETRUEFALSEFALSE2020
22.03.202011TRUEFALSEFALSEFALSE2020
23.03.202023TRUETRUETRUEFALSE2020
24.03.202034TRUETRUETRUETRUE2020
25.03.202015TRUETRUETRUETRUE2020
26.03.202029TRUETRUETRUETRUE2020
27.03.202034TRUETRUETRUETRUE2020
28.03.202013TRUETRUETRUEFALSE2020
29.03.202022TRUETRUEFALSEFALSE2020
30.03.202038TRUETRUETRUETRUE2020
31.03.202019TRUETRUETRUETRUE2020
01.04.202021TRUEFALSEFALSEFALSE2020
02.04.202030FALSEFALSEFALSEFALSE2020


My goal is to create from this table with Summary and Addcolumns a summary by part number, years and number of TRUE in columns Quantity greater than X.

Therefore, my expectet result, should look like this:

Article numberJahrQuantity greater than 0Quantity greater than 1Quantity greater than 2Quantity greater than 3
120194322
220193322
320193332
120204444
220205555
320204433


My procedure in DAX is the following, but unfortunately it does not work.

SummaryTable = SUMMARIZE(T1,T1[part number],T1[year], ADDCOLUMNS(T1, "quantity 1",CALCULATE(COUNTA(T1[quantity 1]),T1[quantity 1]="TRUE")))

 

Since I am not a DAX expert, I need help.
Here is a link to the sampel Excel file: https://1drv.ms/x/s!AoFqgLqZH-C0hMl1UsNeeeAwHaqpSw?e=vkyBtw

 

Thanks a lot

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

What I would do is join the tables by means of Query with the Option Combine, to optimize resources.

While I understood what you are looking for is to group if the quantity x exceeds the desired value.

What I did was simulate your situation in my scenario and I had to create a table in query (combine) to add a conditional column that meets the criterion of what you mention, however place conditional result 1 so that these can be added when using the option group by-

Alexgamb20_3-1654122585237.png

conditional result added, to be able to perform summary.

Alexgamb20_4-1654122604290.png

the next thing I did was use the group/advanced option and place the conditionals and I got as a result what you are looking for.

Alexgamb20_5-1654122690138.png

However if you want to do it in dax, you should have a good xq team run very extensive measures consuming many resources.

I hope I have been able to help you more than anything 🙂.

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

What I would do is join the tables by means of Query with the Option Combine, to optimize resources.

While I understood what you are looking for is to group if the quantity x exceeds the desired value.

What I did was simulate your situation in my scenario and I had to create a table in query (combine) to add a conditional column that meets the criterion of what you mention, however place conditional result 1 so that these can be added when using the option group by-

Alexgamb20_3-1654122585237.png

conditional result added, to be able to perform summary.

Alexgamb20_4-1654122604290.png

the next thing I did was use the group/advanced option and place the conditionals and I got as a result what you are looking for.

Alexgamb20_5-1654122690138.png

However if you want to do it in dax, you should have a good xq team run very extensive measures consuming many resources.

I hope I have been able to help you more than anything 🙂.

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.