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.
Hi All,
I connect to the PBI Dataset which contian the data like below. The Sub Group for Group A & B contain "Total" which equal to calculated in back end. However, for Group C, the dataset only contain Sub Goup "AA" & BB".
Group | Sub Group | Amount |
A | AA | 10 |
A | BB | 20 |
A | Total | 25 |
B | AA | 20 |
B | BB | 30 |
B | Total | 35 |
C | AA | 10 |
C | BB | 10 |
Now, I want to show the table like below
Group | Amount | Explain |
A | 25 | Sum the Group "A" & Sub Group "Total" |
B | 35 | Sum the Group "B" & Sub Group "Total" |
C | XX | Sum the Group "C" & Sub Group "AA" & Sum the Group "C" & Sub Group "BB" * 0.8 |
Is it possible to acheive it DAX formula instead of amendming the Dataset?
Solved! Go to Solution.
Hi @KH_Mike ,
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
SUMMARIZE('Table','Table'[Group],
"Amount",
SWITCH(
TRUE(),
'Table'[Group]="A",CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Group]="A"&&'Table'[Sub Group]="Total")),
'Table'[Group]="B",CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Group]="B"&&'Table'[Sub Group]="Total")),
'Table'[Group]="C",CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Group]="C"&&'Table'[Sub Group] in {"AA","BB"}))*0.8))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @KH_Mike ,
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
SUMMARIZE('Table','Table'[Group],
"Amount",
SWITCH(
TRUE(),
'Table'[Group]="A",CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Group]="A"&&'Table'[Sub Group]="Total")),
'Table'[Group]="B",CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Group]="B"&&'Table'[Sub Group]="Total")),
'Table'[Group]="C",CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Group]="C"&&'Table'[Sub Group] in {"AA","BB"}))*0.8))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Anyone know how to handle this case?
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |