Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hey, I have a measure that takes the created date of a case and finds the difference to todays date.
Solved! Go to Solution.
Hi @avawhittington ,
According to your description, it seems it involves two tables: 'Cases' and 'Partner' and you want to get the count of partners who have the cases with datediff(from case created date to today) is 90~180 days. Am I right? If yes,you can follow the steps below to get it. Please find the details in the attachment.
1. Create two measures as below
MaxDateDiff =
VAR _selpartner =
SELECTEDVALUE ( 'Cases'[Partner ID] )
VAR _maxdate =
CALCULATE (
MAX ( 'Cases'[CreateDate2] ),
FILTER ( ALLSELECTED ( 'Cases' ), 'Cases'[Partner ID] = _selpartner )
)
VAR _datediff =
DATEDIFF ( _maxdate, TODAY (), DAY )
RETURN
_datediff
Count of partner =
CALCULATE (
DISTINCTCOUNT ( 'Cases'[Partner ID] ),
FILTER ( 'Cases', [MaxDateDiff] >= 90 && [MaxDateDiff] <= 180 )
)
2. Create a card visual
Best Regards
Hi @avawhittington ,
According to your description, it seems it involves two tables: 'Cases' and 'Partner' and you want to get the count of partners who have the cases with datediff(from case created date to today) is 90~180 days. Am I right? If yes,you can follow the steps below to get it. Please find the details in the attachment.
1. Create two measures as below
MaxDateDiff =
VAR _selpartner =
SELECTEDVALUE ( 'Cases'[Partner ID] )
VAR _maxdate =
CALCULATE (
MAX ( 'Cases'[CreateDate2] ),
FILTER ( ALLSELECTED ( 'Cases' ), 'Cases'[Partner ID] = _selpartner )
)
VAR _datediff =
DATEDIFF ( _maxdate, TODAY (), DAY )
RETURN
_datediff
Count of partner =
CALCULATE (
DISTINCTCOUNT ( 'Cases'[Partner ID] ),
FILTER ( 'Cases', [MaxDateDiff] >= 90 && [MaxDateDiff] <= 180 )
)
2. Create a card visual
Best Regards
it seems the Card visual is unexpectedly filtered by other contexts, try to plot with a new measure with the code below:
CardMeasure=
CALCULATE
SUM(TableName[Amount]),
FILTER(
ALL(TableName),
[MaxDateDiff]>=90
&& [MaxDateDiff]<=180
)
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |