Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. 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. 🙏
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
19 | |
13 | |
10 | |
9 | |
9 |