Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi everyone,
I have a table with some types of exams and I need to calculate total of them. The issue is that some exams are in column "Exames_Realizados" and some exams are in column "Exames_Adicionais". For exemple:
Name | Exames_Realizados | Exames_Adicionais |
Leonardo | BIÓPSIA POR ESTEREOTAXIA | RNM |
Rafael | BIÓPSIA POR USG | BIOPSIA DE LINFONODO |
Will | BIÓPISIA TIPO1 | BIÓPSIA POR USG |
Sophie | MMG | AGUARDANDO |
Taylor | PAAF LINFONODO | BIÓPSIA POR ESTEREOTAXIA |
Pitty | PAAF TIREOIDE | SEGUIMENTO PELA ESF |
Bryan | RNM | USG |
Maria | USG | BIOPSIA DE LINFONODO |
John | DOPPLER | USG |
I need to know and show how much exams for types were carried out
Solved! Go to Solution.
You can create a new table that combines the "Exames_Realizados" and "Exames_Adicionais" columns. Use the following DAX code:
ExamsTable =
UNION (
SELECTCOLUMNS (
YourTable,
"Name", YourTable[Name],
"Exam", YourTable[Exames_Realizados]
),
SELECTCOLUMNS (
YourTable,
"Name", YourTable[Name],
"Exam", YourTable[Exames_Adicionais]
)
)
Replace 'YourTable' with the name of your original table.
Next, you can create a measure to count the occurrences of each type of exam:
TotalExams =
COUNTROWS (
FILTER (
ExamsTable,
ExamsTable[Exam] <> "AGUARDANDO" && ExamsTable[Exam] <> "SEGUIMENTO PELA ESF"
)
)
You can create a new table that combines the "Exames_Realizados" and "Exames_Adicionais" columns. Use the following DAX code:
ExamsTable =
UNION (
SELECTCOLUMNS (
YourTable,
"Name", YourTable[Name],
"Exam", YourTable[Exames_Realizados]
),
SELECTCOLUMNS (
YourTable,
"Name", YourTable[Name],
"Exam", YourTable[Exames_Adicionais]
)
)
Replace 'YourTable' with the name of your original table.
Next, you can create a measure to count the occurrences of each type of exam:
TotalExams =
COUNTROWS (
FILTER (
ExamsTable,
ExamsTable[Exam] <> "AGUARDANDO" && ExamsTable[Exam] <> "SEGUIMENTO PELA ESF"
)
)
Thank you sooo much. I followed your dax and finally solved the issue. 🙏
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
25 | |
21 | |
19 | |
14 | |
11 |
User | Count |
---|---|
43 | |
35 | |
25 | |
22 | |
22 |