The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to make a custom measure. What I want is to:
I thought I could use a FILTER to do this but that won't work. I am getting an error telling me the syntax for the SUM function is incorrect (have not even squared the number yet).
SUM(FILTER(MyTable, MyTable[class] = "1")[columnToSelect])
Solved! Go to Solution.
Hi @Anonymous !
Create a new column using following DAX to have Sqr. values of your column;
SqrtColumn = SQRT(Table[Column])
Now you can use this new column in your DAX measure formula;
Class = CALCULATE(SUM(Table[SqrtColumn]), FILTER(Table, Table[Class] = "1"))
Regards,
Hasham
Hi @Anonymous !
You can use following DAX coede;
Class = CALCULATE(SUM(Table[Column]), FILTER(Table, Table[Class] = "1"))
Table is your table name & column is your column you want to sum.
Regards,
Hasham
How would one square all values before summing them?
Hi @Anonymous !
Create a new column using following DAX to have Sqr. values of your column;
SqrtColumn = SQRT(Table[Column])
Now you can use this new column in your DAX measure formula;
Class = CALCULATE(SUM(Table[SqrtColumn]), FILTER(Table, Table[Class] = "1"))
Regards,
Hasham
User | Count |
---|---|
25 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
28 | |
13 | |
12 | |
12 | |
6 |