Hello everyone, thanks in advance for helping. I am kinda new in Power Bi and DAS.
I do have a table with 2 fields, Patient (Identifier of my patients) and Date (Exact day when I assist them). I do want to obtain a new 2 columns.
The first one (Unique) should let me know if I have seen the patient before (yes) or just 1 time (no).
The second one (Repeated) should let me know how many times I have seen the patient.
I post here an example of 4 patients and who the new calculated fields (columns Unique and repeated) should look like.
Thanks a lot!
Go to Solution.
Sure. Unique should be a pretty easy DAX measure:
Unique = IF( CALCULATE( COUNT(Table1[Patient]), ALL(Table1) ) > 1, "NO", "YES")
Repeated is slightly harder, but still easy DAX:
Repeated = CALCULATE( COUNT(Table1[Patient]), FILTER(ALLEXCEPT(Table1, Table1[Patient]), Table1[Date] < SELECTEDVALUE(Table1[Date]) ) )
View solution in original post
Could it be because you are giving semicolon and not comma after NO?
( screensnot below)
Hello @Cmcmahan , Thanks a lot for your reply!!
But it does not work. If you try it with the table above. It returns an error message: "The syntax for "NO" is an error (DAX(
Yup. This is 100% due to regional settings. You'll have that issue pretty commonly on the board. There's a good mix of us that use commas instead of semicolons and vice versa. Double check any queries you get here for basic structure.
@areymejias regarding repeated, you can try:
Kudos to you if you earned one of these! Check your inbox for a notification.
Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.
Find out where you can attend!