Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Solved! Go to Solution.
Hi @FreyeDW ,
If you need the admin not to be in that period then you should use something similar to this:
# Seen 08/01/2022-03/31/2023 and Admin equals Recorded 08/01/2022-03/31/2023 =
VAR _table =
CALCULATETABLE (
'PT BASE',
DATESBETWEEN (
'PT BASE'[EncounterDTTM],
DATE ( 2022, 08, 01 ),
DATE ( 2023, 03, 31 )
),
NOT( DATESBETWEEN (
'PT BASE'[Vaccine Administered Date],
DATE ( 2022, 08, 01 ),
DATE ( 2023, 03, 31 )
)),
DATESBETWEEN (
'PT BASE'[Vaccine Recorded Date],
DATE ( 2022, 08, 01 ),
DATE ( 2023, 03, 31 )
)
)
RETURN
COUNTROWS ( _table ) + 0
Again without data is diffiicult to pin point if this works.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi! @mfeyx I am hoping to piggy back off of this post. I have a very similar issue and I am trying to find a distinct count of ID numbers who have donated before a certain date, after a certain date, and NOT during a certain date range. I have tried to modify this as
Hi
The problem is that you did not defined the variable just need toadd vat _table.
Here is the full code
Retention measure =
VAR _table =
CALCULATETABLE (
'Table1',
DATESBETWEEN ( Table1[Gift date], DATE ( 2023, 07, 01 ), DATE ( 2024, 06, 30 ) ),
NOT (
DATESBETWEEN ( Table1[Gift date], DATE ( 2022, 07, 01 ), DATE ( 2023, 60, 30 ) )
),
DATESBETWEEN ( Table1[Gift date], DATE ( 1980, 01, 01 ), DATE ( 2022, 06, 30 ) )
)
RETURN
COUNTROWS ( _table ) + 0
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi! Thanks for you response! When i modified that I got this error message "The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column." not sure what to do with that.
Thanks!
Hi @FreyeDW ,
The issue is the part of the formula where you do:
DATESBETWEEN (
'PT BASE'[Vaccine Administered Date],
DATE ( 2022, 08, 01 ),
DATE ( 2023, 03, 31 )
)
= DATESBETWEEN (
'PT BASE'[Vaccine Recorded Date],
DATE ( 2022, 08, 01 ),
DATE ( 2023, 03, 31 )
)
You are comparing to datesbetween and that is not allowed that is the error you are getting believe that you need to redo the measure with a comma and not an equal:
# Seen 08/01/2022-03/31/2023 and Admin equals Recorded 08/01/2022-03/31/2023 =
VAR _table =
CALCULATETABLE (
'PT BASE',
DATESBETWEEN (
'PT BASE'[EncounterDTTM],
DATE ( 2022, 08, 01 ),
DATE ( 2023, 03, 31 )
),
DATESBETWEEN (
'PT BASE'[Vaccine Administered Date],
DATE ( 2022, 08, 01 ),
DATE ( 2023, 03, 31 )
),
DATESBETWEEN (
'PT BASE'[Vaccine Recorded Date],
DATE ( 2022, 08, 01 ),
DATE ( 2023, 03, 31 )
)
)
RETURN
COUNTROWS ( _table ) + 0
Not sure if I got the correct result you want to achieve only from the description but your error is because of the issue above identified.
If this formula does not return expected result can you share some more insight on what is the result you want to have.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThank You, I am validating that solution right now, so far it looks good!
So then the next question would be since this is where the Admin equals Recorded, how would the measure go if I need Admin NOTequal to Recorded?
Hi @FreyeDW ,
If you need the admin not to be in that period then you should use something similar to this:
# Seen 08/01/2022-03/31/2023 and Admin equals Recorded 08/01/2022-03/31/2023 =
VAR _table =
CALCULATETABLE (
'PT BASE',
DATESBETWEEN (
'PT BASE'[EncounterDTTM],
DATE ( 2022, 08, 01 ),
DATE ( 2023, 03, 31 )
),
NOT( DATESBETWEEN (
'PT BASE'[Vaccine Administered Date],
DATE ( 2022, 08, 01 ),
DATE ( 2023, 03, 31 )
)),
DATESBETWEEN (
'PT BASE'[Vaccine Recorded Date],
DATE ( 2022, 08, 01 ),
DATE ( 2023, 03, 31 )
)
)
RETURN
COUNTROWS ( _table ) + 0
Again without data is diffiicult to pin point if this works.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThank You! This is looking great so far. Now I know where to put that NOT.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
78 | |
41 | |
40 | |
35 |