The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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. 🙏
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
18 | |
18 | |
17 | |
15 | |
11 |
User | Count |
---|---|
35 | |
35 | |
19 | |
19 | |
14 |