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.
Hello,
I have the below table structure, where blue is fact and I need to calculate three additional columns.
One of them I managed to calculate, but I can't find a way to calculate the other two (which are actually interlinked.
Can you please help?
Distinct Cat Concatenation | CONCATENATEX(FILTER(SUMMARIZE(Table1,Table1[Deal],Table1[Cat]),Table1[Deal]=EARLIER(Table1[Deal])), Table1[Cat]," | ") |
Cat Qty | need help, tried CALCULATE(SUM(Qty),Table1[Deal]=EARLIER(Table1[Deal]),(Table1[Deal])), Table1[Cat]) and it does not work |
Distinct Cat & Qty Concatenation | need help |
Solved! Go to Solution.
Hi @ChPetru ,
I have modified my original reply, please check.
Best Regards,
Jinwei Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ChPetru ,
I have modified my original reply, please check.
Best Regards,
Jinwei Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ChPetru
According to your description, you want:
Please try:
Cat Qty =
CALCULATE (
SUM ( Table1[Qty] ),
FILTER (
'Table1',
'Table1'[Deal] = EARLIER ( 'Table1'[Deal] )
&& 'Table1'[Cat] = EARLIER ( Table1[Cat] )
)
)
Distinct Cat Concatenation =
CONCATENATEX (
FILTER (
SUMMARIZE ( Table1, Table1[Deal], Table1[Cat] ),
Table1[Deal] = EARLIER ( Table1[Deal] )
),
Table1[Cat],
" | "
)
Distinct Cat & Qty Concatenation =
VAR _t =
ADDCOLUMNS (
SUMMARIZE ( 'Table1', [Deal], [Cat], [Cat Qty] ),
"Combine",
[Cat] & " " & [Cat Qty]
)
RETURN
CONCATENATEX ( _t, [Combine], " | " )
Output:
Best Regards,
Jinwei Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Jinwei,
Qty works if i swtich the first Table1'[Cat] = EARLIER ( 'Table1'[Cat] to Table1'[Deal] = EARLIER ( 'Table1'[Deal].
Distinct Cat Concatenation also works.
Distinct Cat & Qty Concatenation however seems to work (no error) but runs indefinately and I have to end task (I actually waited 1h on a fairly small dataset, and still no result).
@ChPetru , try new measures like
CALCULATE(SUM(Qty),filter(Table, Table1[Deal]=EARLIER(Table1[Deal])),Table1[Deal])
or
CALCULATE(SUM(Qty),filter(Table, Table1[Deal]=EARLIER(Table1[Deal]) && Table1[Cat] =earlier(Table1[Cat]) ),Table1[Deal])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
45 | |
25 | |
19 | |
16 | |
8 |
User | Count |
---|---|
65 | |
50 | |
45 | |
20 | |
17 |