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.
I am a newby to Power BI and am trying to create a measure that sums a measure 'FACT-Accounting'[Total Expense] based on columns named 'FACT-Accounting'[GLACT] and 'FACT-Accounting'[Month Name]. I found a formula on line that looked as though it would work:
1 Total Monthly Expense by GL Code = 2 GROUPBY('FACT-Accounting','FACT-Accounting'[GLACNT],'FACT-Accounting'[Month Name], 3 "Total Monthly Expense", SUMX(CURRENTGROUP(),'FACT-Accounting'[Total Expense]))However, I get the error message "The CALCULATE function cannot be used in an expression
My suggestion would be to first try to learn the bare minimum about Power BI and DAX to understand the basic concepts and only then start working with this. There are many great resources around the Internet. Just a question of reaching out. You can start with YouTube.
GROUPBY is a very, very, very, bad choice and signalizes you're just trying to do Power BI in a careless, unthoughtful, monkey fashion. THIS WILL NOT WORK, I'm afraid. It's like giving a monkey a razor... You can do more harm to others and yourself than you can imagine. No, sorry to say that but it's actually TRUE.
Best
Darek
if you want the 'FACT-Accounting'[GLACT] and 'FACT-Accounting'[Month Name] in the rows of the table visual then simple SUM will be enough (it will calculate it based on the filter context of the columns you put in the visual)
Expense = SUM('FACT-Accounting'[Total Expense])
So basically:
1) create the Expense measure
2) drag 'FACT-Accounting'[GLACT] to the visual
3) change the visual to table
4) drag 'FACT-Accounting'[Month Name] to the same visual
5) drag the measure from 1) to the same visual
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 |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
18 |