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 Guys, Can someone help to get the formula in a calculated Column. (I derived it in Measure, but i need the same calculation in Calculated Column).
Measure Formula: Current Month Total = CALCULATE( SUM('Table1'[Month 1]), 'Table1'[Class] IN { "A" } )
Class | Month 1 | Month 2 | Month 3 |
A | 10 | 20 | 22 |
B | 12 | 13 | 123 |
A | 13 | 14 | 12 |
Solved! Go to Solution.
hi @Anonymous
Do you want show this expected output in power bi calculated table?
If so, you need to create a new table like below:
New table = SUMMARIZE(Table1,Table1[Subject],"Month 1",CALCULATE(SUM(Table1[Month1]),FILTER(Table1,Table1[Class]="A")))
Result:
here is sample pbix file, please try it.
Regards,
Lin
hi @Anonymous
Just adjust the formula as below:
@v-lili6-msft this formula which you provided sums all i guess.., i am not getting the value only for that particular selection. 😞
Create a column like
Current Month = if('Table1'[Class] IN { "A" },'Table1'[Month 1],blank() )
and choose Agg sum when use.
But I not clear with data model you posted.
In case you are looking for slicer to give you which measure then refer
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin
@amitchandak this doesnt gives the correct value.., All i need is to filter "A" in Class and get the Month1 data for all A in calculated Column. Below is my exact version of data which i loaded in Power BI.
Subject | Class | Month1 |
Maths | A | 10 |
Maths | B | 13 |
Maths | A | 11 |
Computer | A | 24 |
The value which i expect is in Power BI Table is:
Subject | Month 1 |
Maths | 21 |
Computer | 24 |
it just filter only "A" and provide the value against it.
Measure Formula which works: Current Month Total = CALCULATE( SUM('Table1'[Month 1]), 'Table1'[Class] IN { "A" } )
and same formula i need in Calcluated Column...
hi @Anonymous
Do you want show this expected output in power bi calculated table?
If so, you need to create a new table like below:
New table = SUMMARIZE(Table1,Table1[Subject],"Month 1",CALCULATE(SUM(Table1[Month1]),FILTER(Table1,Table1[Class]="A")))
Result:
here is sample pbix file, please try it.
Regards,
Lin
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 |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |