Forum Discussion
How to use both Avg and sum function in DAX
HI PietroFarias
I tried the measure but I'm getting following error
Error Message:
ORA-00904: "t1"."QTR2_TARGET": invalid identifier. The exception was raised by the IDbCommand interface.
Charu,
Do you connect to Oracle in Power BI Desktop? Could you please post a screenshot about how you apply PietroFarias's DAX in your table?
Regards,
Lydia
- Charu8 years ago
Post Patron
Hi Anonymous
Yeah, I'm connecting oracle database direct query mode and in the advanced options passing SQL statements(many tables join) and getting data.
Sample is
ID | Code | Tgt 1 | Tgt2 | Tgt3 | Tgt4
1 | 001 | 0 | 0 | 0 | 0
2 | 003 | 1 | 0 | 0 | 0
I need to take sum (tgt1,tgt2,tgt3,tgt4) and then the Avg of the sum(tgt1,tgt2,tgt3,tgt4)
I have created measure as suggest by PietroFarias
Measure:= AVERAGEX(Tablename;[Tgt1]+[Tgt2]+[Tgt3]+[Tgt4])
- PietroFarias8 years ago
Resolver II
Oh! This case, AVERAGEX not is Supported. In measure and query formulas only.
DAX formula compatibility in DirectQuery mode
See the post below, from this forum, if you help.