Forum Discussion
Total End Formula
- 8 months ago
Aw, I see, you dont want to sum all the rows belonging to the segment, rather you sum only certain rows in the segment. In that case forget about my solution.
- 8 months ago
Hi 3mmanuel_12
You can try this. It will convert that text into a virtual table inside a measure, with no extra tables.My Total :=
VAR IsFormula = SELECTEDVALUE('Cernol Template'[Totalling Type]) = "Formula"
VAR FormulaText = SELECTEDVALUE('Cernol Template'[Totalling]) -- e.g. "3,4,5,6,7,13"VAR FormulaTable =
ADDCOLUMNS(
TEXTSPLIT(FormulaText, ","), -- → {"3","4","5","6","7","13"}
"Seq", VALUE([Value]) -- convert to number
)RETURN
IF(
IsFormula,
CALCULATE(
'_Acc Ledger'[Total Amount],
TREATAS(FormulaTable, '_Acc schedule'[L1 Sequence])
),
'_Acc Ledger'[Total Amount]
)Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Jaywant Thorat | MCT | Data Analytics Coach
Linkedin: https://www.linkedin.com/in/jaywantthorat/ - 8 months ago
Hi 3mmanuel_12 ,
Thank you for reaching out to the Microsoft Community Forum.
Please try below two solutions.
1. Refer below DAX measure.
Total Sales Selected =
CALCULATE(
SUM('Sales'[Amount]),
'Sales'[Header] IN {
"FOOD INDUSTRY",
"GENERAL INDUSTRIAL",
"HORECA",
"QSR",
"HEALTHCARE",
"HYGIENE SHOP"
}
)2. You can add a logical/grouping column in Power Query.
Add Column --> Conditional Column
Example:
Header IncludeInTotal
FOOD INDUSTRY 1
HORECA 1
GENERAL INDUSTRIAL 1Total Sales Selected =
CALCULATE(
SUM('Sales'[Amount]),
'Sales'[IncludeInTotal] = 1
)I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
Hi 3mmanuel_12 ,
Thank you for reaching out to the Microsoft Community Forum.
Please try below two solutions.
1. Refer below DAX measure.
Total Sales Selected =
CALCULATE(
SUM('Sales'[Amount]),
'Sales'[Header] IN {
"FOOD INDUSTRY",
"GENERAL INDUSTRIAL",
"HORECA",
"QSR",
"HEALTHCARE",
"HYGIENE SHOP"
}
)
2. You can add a logical/grouping column in Power Query.
Add Column --> Conditional Column
Example:
Header IncludeInTotal
FOOD INDUSTRY 1
HORECA 1
GENERAL INDUSTRIAL 1
Total Sales Selected =
CALCULATE(
SUM('Sales'[Amount]),
'Sales'[IncludeInTotal] = 1
)
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
- v-dineshya8 months agoCommunity Support
Hi 3mmanuel_12 ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh
- v-dineshya8 months agoCommunity Support
Hi @3mmanuel_12 ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh