Forum Discussion
Calculated Row using Power BI DAX
- Anonymous4 years ago
Hi Dulay
I have checked your code by my sample. I think the logic of your code is correct. There may be something wrong in your filter or calculation. Here I will give you some suggestions.
My sample is as below.
Actual PL:
Item Group
Calendar table is a calculate table.
Calendar = ADDCOLUMNS(CALENDARAUTO(),"Year",YEAR([Date]),"QTR","Qtr"&" "&QUARTER([Date]))Relationship:
I think list part in Var in your code is useless, we can remove it and the code will still work successfully.
My result:
1. Please check your Matric, you should use [Item Group] from "Item Group" table.
2. Please check your code and make sure values in "Switch" function like "EBITDA" are correct. If they are wrong, your measure will return blank.
3. Check the your calculate by "EBITDA", maybe REVENUE - EXPENSE are the same the return to blank.
You can download my sample to get more details.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yes. These are the rows in the Item Group table
Hi Dulay
I have checked your code by my sample. I think the logic of your code is correct. There may be something wrong in your filter or calculation. Here I will give you some suggestions.
My sample is as below.
Actual PL:
Item Group
Calendar table is a calculate table.
Calendar = ADDCOLUMNS(CALENDARAUTO(),"Year",YEAR([Date]),"QTR","Qtr"&" "&QUARTER([Date]))
Relationship:
I think list part in Var in your code is useless, we can remove it and the code will still work successfully.
My result:
1. Please check your Matric, you should use [Item Group] from "Item Group" table.
2. Please check your code and make sure values in "Switch" function like "EBITDA" are correct. If they are wrong, your measure will return blank.
3. Check the your calculate by "EBITDA", maybe REVENUE - EXPENSE are the same the return to blank.
You can download my sample to get more details.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Dulay4 years agoNew Member
Thanks very much Anonymous
Was able to solve this by removing the SORTing of Item Group using SORT Column. Both are in Item Group table.
Your solution is great also.