Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have the following table with repeated records, except for the sale column. I need, according to this example, to group by the date, state, and contract columns, and of the records that I have left, to filter by the value of the state = 1 column and hence the one with the maximum value of the date field, the sum from the Contract Value column:
Date State Contract contract Value Sales Type
202001 1 123456 34.000 shoes
202001 1 123456 34.000 socks
202001 0 123456 10.000 socks
202001 1 234567 44.000 shoes
202001 1 234567 44.000 socks
202001 0 234567 10.000 socks
202001 1 345678 55.000 shoes
202001 1 345678 55.000 socks
202001 0 345678 10.000 socks
202002 0 123456 10.000 shoes
202002 0 234567 11.000 socks
202002 0 345678 12.000 shoes
As a result, it will be the following with 133.000 as a contract value. As there is no date with value 202002 with state = 1, we will have to take the sum of the dates that have 202001 and that the state is = 1:
Date State Contract Contract Value
202001 1 123456 34.000
202001 1 234567 44.000
202001 1 345678 55.000
Thank you very much in advance,
Mayte
Hi @Anonymous
try a new calculated table
Table 2 = summarize(filter('Table';'Table'[State]=1);'Table'[Date];'Table'[State];'Table'[Contract];"Contract Value";MAX('Table'[contract Value]))
do not hesitate to give a kudo to useful posts and mark solutions as solution
Hi @Anonymous38,
Thanks for your answer, but it´s not working.
In this case, I need to:
First: Filter for state = 1
Second: Get the maximum value of date. In this case, it is 202001 (although it´s not a date value, it´s a number value), because 202002 has 0 value in field state.
Third: Group by Date value and contract Field and summarize Contract Value field.
Thanks again,
Mayte
User | Count |
---|---|
25 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
9 | |
6 |