Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I have a table that has several medical appointments, in these appointments it is reported which patient id, disease, and the date of appointment, I need a measure where I can get the different number of patients who have a certain disease that the care was performed between a certain period.
the measure i created is not right, but i will forward it here to try to understand the idea
Solved! Go to Solution.
Hi @courartinfo ,
Change your dax as below:
Diabeticos Jan20 a Jan21 =
CALCULATE (
DISTINCTCOUNT ( atendimento_individual_problemas[co_fat_cidadao_pec] ),
FILTER (
atendimento_individual_problemas,
atendimento_individual_problemas[Condições] = "diabetes"
&& atendimento_individual_problemas[Periodo concatenado] >= DATE ( 2020, 01, 01 )
&& atendimento_individual_problemas[Periodo concatenado] <= DATE ( 2021, 01, 01 )
)
)
You could use the below to check your dax :
If question still not solved ,could you pls share your pbix file? Remember to remove confidential data.
Best Regards
Lucien
Hi @courartinfo ,
Change your dax as below:
Diabeticos Jan20 a Jan21 =
CALCULATE (
DISTINCTCOUNT ( atendimento_individual_problemas[co_fat_cidadao_pec] ),
FILTER (
atendimento_individual_problemas,
atendimento_individual_problemas[Condições] = "diabetes"
&& atendimento_individual_problemas[Periodo concatenado] >= DATE ( 2020, 01, 01 )
&& atendimento_individual_problemas[Periodo concatenado] <= DATE ( 2021, 01, 01 )
)
)
You could use the below to check your dax :
If question still not solved ,could you pls share your pbix file? Remember to remove confidential data.
Best Regards
Lucien
You need to turn the numbers (2021,01,01) into a Date format. You can use the Date function to do this. You have Date in your formula - but it's in the wrong spot! You want:
This gives you some more info on how to use the DATE function in DAX. https://dax.guide/date/
I made the change and the syntax error was fixed, but now another one has appeared...
The '3' argument in the CALCULATE function is required.
I think you have an extra comma at the end.
"measure i created is not right" - Are you getting a syntax error on this or something else?
the power bi flips error in DATE syntax,
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.