Forum Discussion
Anonymous
4 years agoNot applicable
Need help with DAX
Hi Team , I am facing issue with the below mentioned DAX formula CYCQCW-Win Rev = IF(and(AND([Fcst]="CQ",OR([SS_No]="07",[SS_No]="08")),[WEEK_NUM]= MAX(IF( [Fcst]="CQ",[WEEK_NUM],BLANK...
- 4 years ago
I wasn't quite sure what you wanted as a result (500 on every CQ? or a measure?)
Anyway here's a column:
ColumnX = var _fcst = TableA[FCST] RETURN IF (_fcst = "CQ", CALCULATE(SUM(TableA[REVENUE]), FILTER(TableA, TableA[WEEK] = 4 && TableA[STAGE] IN {"07", "08"} && TableA[FCST] = _fcst)))If it's not quite what is required at least you can edit it for desired result
HotChilli
Community Champion
4 years ago1. a measure requires an aggregation (MIN, MAX etc) so it throws the error.
2. The MAX is wrapped round an 'IF' and it needs a column so there's an error.
Maybe post some data (as text) and explain what you are trying to do
Anonymous
4 years agoNot applicable
Hi HotChilli ,
Thanks for replying!!
Here is some sample data ,
i am looking fcst should be CQ and stage should be either 07 or 08 and sum (revenue) for max of week in this case where ever it is 4 , so the value should be 500
| FCST | WEEK | STAGE | REVENUE |
| CQ | 1 | 07 | 100 |
| CQ | 4 | 07 | 300 |
| CQ | 4 | 08 | 200 |