Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am trying to replicate one formula from Business Objects to Power BI DAX which reads as follows.
If ([Type] = "Charted") Then (If IsNull([vCountofChanges] Where([Calendar Days] >= [LeadDays])) Then 0
Else [vCountofChanges] Where([Calendar Days] >= [LeadDays]))
Else (If IsNull([vCountAllChanges] Where([Calendar Days] >= [LeadDays])) Then 0
Else [vCountofChanges] Where([Calendar Days] >= [LeadDays]))
I can only create a measure DAX to replicate above formula . I wrote the following DAX measure but it is giving me an errror. Can someone please correct my DAX.
IF(MAX('Change Requests'[Type]="Charted"),IF(ISBLANK(CALCULATE([vCountofChanges],
FILTER('Change Requests','Change Requests'[Calendar Days]>=[LeadDays]),0,CALCULATE([vCountofChanges],FILTER('Change Requests','Change Requests'[Calendar Days]>=[LeadDays]))))))
Solved! Go to Solution.
Hi @vishu263
please try
=
IF (
MAX ( 'Change Requests'[Type] ) = "Charted",
SUMX (
VALUES ( 'Change Requests'[Calendar Days] ),
IF ( 'Change Requests'[Calendar Days] >= [LeadDays], [vCountofChanges], 0 )
)
)
Hi @vishu263
Please try
=
IF (
MAX ( 'Change Requests'[Type] ) = "Charted",
COALESCE (
ISBLANK (
CALCULATE (
[vCountofChanges],
FILTER ( 'Change Requests', 'Change Requests'[Calendar Days] >= [LeadDays] )
)
),
0
)
)
@tamerj1 Thanks for your quick response.
I used the DAX given by you and named it Test 2. However, its not giving me any values. Ideally, it should give me the total as 2 because there are overall 2 instances where 'Calendar days' are greater than or equal to 'LeadDays'.
Please refer to below snapshot for your reference.
Hi @vishu263
please try
=
IF (
MAX ( 'Change Requests'[Type] ) = "Charted",
SUMX (
VALUES ( 'Change Requests'[Calendar Days] ),
IF ( 'Change Requests'[Calendar Days] >= [LeadDays], [vCountofChanges], 0 )
)
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
15 | |
10 |
User | Count |
---|---|
57 | |
50 | |
44 | |
21 | |
19 |