Forum Discussion
DAX: Use renamed columns in visual
- 1 year ago
Hi Heinrich,
Thank you for your detailed explanation and for sharing the DAX queries. I understand the two issues you're encountering, and I will address them both.
The error you're seeing suggests that the column 'PSTN Trunk FQDN' is being used in a calculation without an aggregation function. To fix this, you can apply an aggregation method such as SUM, MIN, MAX, or COUNT to the 'PSTN Trunk FQDN' column. Here's an updated example:
DAX:"SumPSTN_NER_Good_Percentage", CALCULATE(SUM('CQD'[PSTN NER Good Percentage]), ALLEXCEPT('CQD', 'CQD'[PSTN Trunk FQDN]))Concerning the issue with receiving emails from Flow where the column names appear in brackets, this is likely due to how the columns are referenced in your DAX query. Please ensure that the field names in the SELECTCOLUMNS function do not include any special characters such as brackets. The following updated query should resolve the issue:
DAX:DEFINE VAR __DS0Core = SUMMARIZECOLUMNS( 'CQD'[PSTN Trunk FQDN], "SumPSTN_NER_Good_Percentage", CALCULATE(SUM('CQD'[PSTN NER Good Percentage])) ) VAR __DS0PrimaryWindowed = TOPN(501, __DS0Core, 'CQD'[PSTN Trunk FQDN], 1) EVALUATE SELECTCOLUMNS( __DS0PrimaryWindowed, // Use the filtered result set "SBC", 'CQD'[PSTN Trunk FQDN], // Rename 'PSTN Trunk FQDN' to SBC "NER", [SumPSTN_NER_Good_Percentage] // Rename 'SumPSTN_NER_Good_Percentage' to NER ) ORDER BY SBC
Please try these adjustments and let me know how it works for you. If you need further assistance, feel free to reach out!
Thank you.
Hello v-kpoloju-msft
I managed to run it:
// DAX Query
DEFINE
VAR __DS0Core =
SUMMARIZECOLUMNS(
'CQD'[PSTN Trunk FQDN],
"SumPSTN_NER_Good_Percentage", CALCULATE(SUM('CQD'[PSTN NER Good Percentage]))
)
VAR __DS0PrimaryWindowed =
TOPN(501, __DS0Core, 'CQD'[PSTN Trunk FQDN], 1)
EVALUATE
SELECTCOLUMNS(
__DS0PrimaryWindowed, // Use the filtered result set
"SBC", 'CQD'[PSTN Trunk FQDN], // Rename 'PSTN Trunk FQDN' to SBC
"NER", [SumPSTN_NER_Good_Percentage] // Rename 'SumPSTN_NER_Good_Percentage' to NER
)
ORDER BY
"SBC"
When I receive a mail from Flow the words are in Brackets. Is it possible to remove them.
Regards
Heinrich
Hi Heinrich,
Thank you for your detailed explanation and for sharing the DAX queries. I understand the two issues you're encountering, and I will address them both.
The error you're seeing suggests that the column 'PSTN Trunk FQDN' is being used in a calculation without an aggregation function. To fix this, you can apply an aggregation method such as SUM, MIN, MAX, or COUNT to the 'PSTN Trunk FQDN' column. Here's an updated example:
DAX:
"SumPSTN_NER_Good_Percentage", CALCULATE(SUM('CQD'[PSTN NER Good Percentage]), ALLEXCEPT('CQD', 'CQD'[PSTN Trunk FQDN]))
Concerning the issue with receiving emails from Flow where the column names appear in brackets, this is likely due to how the columns are referenced in your DAX query. Please ensure that the field names in the SELECTCOLUMNS function do not include any special characters such as brackets. The following updated query should resolve the issue:
DAX:
DEFINE
VAR __DS0Core =
SUMMARIZECOLUMNS(
'CQD'[PSTN Trunk FQDN],
"SumPSTN_NER_Good_Percentage", CALCULATE(SUM('CQD'[PSTN NER Good Percentage]))
)
VAR __DS0PrimaryWindowed =
TOPN(501, __DS0Core, 'CQD'[PSTN Trunk FQDN], 1)
EVALUATE
SELECTCOLUMNS(
__DS0PrimaryWindowed, // Use the filtered result set
"SBC", 'CQD'[PSTN Trunk FQDN], // Rename 'PSTN Trunk FQDN' to SBC
"NER", [SumPSTN_NER_Good_Percentage] // Rename 'SumPSTN_NER_Good_Percentage' to NER
)
ORDER BY
SBC
Please try these adjustments and let me know how it works for you. If you need further assistance, feel free to reach out!
Thank you.
- Heinrich1 year ago
Post Partisan
Hi v-kpoloju-msft
Thank you for your help
The difference between your script and mine wasyour script: Order by / SBC
mine: Order by / "SBC"
Your proposal throwed an error
"Query (24, 2) Failed to resolve name 'SBC'."with the char " it works.
I have done exactly that but the brackets keep showing up.I have done it within Power Automate by editing the HTML Table.
Do you have an ideaHave a great day
Heinrich