Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Good Morning,
I'm struggling with a simple calculation in Power Bi. I have a large table of employers. There is a column for each month of the year and the sum of funding for each month, and then there is a total column, which totals all funding for each employer. I would like to get the total sum for 3 specific employers, who I shall call, Employer A, Employer B and Employer C. Could someone help with the measure I need to achieve this? Thanks
Solved! Go to Solution.
@DenbyG , Create a measure like
Calculate(sum(Fact[Value]), filter(Fact, Fact[Employer] in {"Employer 1","Employer 2","Employer 3"}))
or with joined dim
Calculate(sum(Fact[Value]), filter(Dim, Dim[Employer] in {"Employer 1","Employer 2","Employer 3"}))
Need the same value in when use employeer in group by
Calculate(sum(Fact[Value]), Fact[Employer] in {"Employer 1","Employer 2","Employer 3"})
in needed refer: Difference in filtering data in CALCULATE with and without FILTER
https://youtu.be/KDcmzwgPvXQ
Hi @DenbyG
Total Funding for A, B, C =
CALCULATE(
SUM(Employers[Total]),
Employers[Employer] IN {"Employer A", "Employer B", "Employer C"}
)
SUM(Employers[Total]) adds up the values in the Total column.
CALCULATE changes the filter context so it only includes rows where Employer is one of the three specified.
The IN operator makes it easy to check multiple values.
--------------------------------
I hope this helps, please give kudos and mark as solved if it does!
Connect with me on LinkedIn.
Subscribe to my YouTube channel for Fabric/Power Platform related content!
Hi @DenbyG ,
try measure below:
Total Funding Selected Employers =
CALCULATE(
SUM('Employers'[Funding]),
FILTER(
'Employers',
'Employers'[Employer Name] = "Employer A" ||
'Employers'[Employer Name] = "Employer B" ||
'Employers'[Employer Name] = "Employer C"
)
)Please give kudos or mark it as solution once confirmed.
Thanks and Regards,
Praful
TotalFunding_ABC =
CALCULATE(
SUM('Employers'[Total]),
'Employers'[Employer] IN {"Employer A", "Employer B", "Employer C"}
)
If this answer helped, please click Kudos or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande
TotalFunding_ABC =
CALCULATE(
SUM('Employers'[Total]),
'Employers'[Employer] IN {"Employer A", "Employer B", "Employer C"}
)
If this answer helped, please click Kudos or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande
Hi @DenbyG ,
try measure below:
Total Funding Selected Employers =
CALCULATE(
SUM('Employers'[Funding]),
FILTER(
'Employers',
'Employers'[Employer Name] = "Employer A" ||
'Employers'[Employer Name] = "Employer B" ||
'Employers'[Employer Name] = "Employer C"
)
)Please give kudos or mark it as solution once confirmed.
Thanks and Regards,
Praful
Hi @DenbyG
Total Funding for A, B, C =
CALCULATE(
SUM(Employers[Total]),
Employers[Employer] IN {"Employer A", "Employer B", "Employer C"}
)
SUM(Employers[Total]) adds up the values in the Total column.
CALCULATE changes the filter context so it only includes rows where Employer is one of the three specified.
The IN operator makes it easy to check multiple values.
--------------------------------
I hope this helps, please give kudos and mark as solved if it does!
Connect with me on LinkedIn.
Subscribe to my YouTube channel for Fabric/Power Platform related content!
@DenbyG , Create a measure like
Calculate(sum(Fact[Value]), filter(Fact, Fact[Employer] in {"Employer 1","Employer 2","Employer 3"}))
or with joined dim
Calculate(sum(Fact[Value]), filter(Dim, Dim[Employer] in {"Employer 1","Employer 2","Employer 3"}))
Need the same value in when use employeer in group by
Calculate(sum(Fact[Value]), Fact[Employer] in {"Employer 1","Employer 2","Employer 3"})
in needed refer: Difference in filtering data in CALCULATE with and without FILTER
https://youtu.be/KDcmzwgPvXQ
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 23 | |
| 14 | |
| 10 | |
| 6 | |
| 5 |