Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

DAX Measure

Hi All,

Need a help in resolving my query.

I have created a calculated column Name  (Remit Status) which is working fine , when i am placing in table(Logic below)

remit status =
if(ProjectPhases[actual_date_01]=BLANK()
&& NOW()>ProjectPhases[Remit_Target_Date],"Overdue",
if(ProjectPhases[actual_date_01]=BLANK()
&& NOW()>DATEADD(ProjectPhases[Remit_Target_Date],-28,DAY),"Due in 4 weeks",
if(ProjectPhases[actual_date_01]=TODAY()
    || (ProjectPhases[actual_date_01]<(ProjectPhases[Remit_Target_Date])) ,"Approved on Time",
if(ProjectPhases[actual_date_01]=TODAY()
    || (ProjectPhases[actual_date_01]>(ProjectPhases[Remit_Target_Date])) ,"Approved Late", " "
))))
 
Now, my requirement is to place each status(eg: Overdue, due in 4 weeks , Approved on Time & Approved Late) as seperate DAX measure which needs to be mentioned as count in Card Visual.
DAX1:  (Just calculating, based on the remit status column which i created above)
remit_overdue =
VAR cnt =
COUNTX (
FILTER (
ProjectPhases,
ProjectPhases[remit status]
= "Overdue"
),
MIN ( Projects[AuditCode] )
)
VAR ret_cnt =
IF ( cnt = BLANK (), 0, cnt )
RETURN
ret_cnt
 
 
Dax2 :
Remits_Duein4weeks =
VAR cnt =
COUNTX (
FILTER (
ProjectPhases,
            ProjectPhases[actual_date_01]=BLANK()
            &&
ProjectPhases[actual_date_01]
> DATE ( YEAR ( NOW () ), MONTH ( NOW () ), DAY ( NOW () ) )
&& ProjectPhases[Remit_Target_Date]
> DATE ( YEAR ( NOW () ), MONTH ( NOW () ), DAY ( NOW () ) - 28 )
),
MIN ( Projects[AuditCode] )
)
VAR ret_cnt =
IF ( cnt = BLANK (), 0, cnt )
RETURN
ret_cnt
Please note both the dax where not working.
Need your Assistance.
 
Cheers,
Saiiii
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @amitchandak 

Please correct me if I wrongly understood your problem.

You want to calculate the number of rows for ProjectPhases[Remit Status]="Overdue" and ProjectPhases[Remit Status]="Due in 4 weeks", right ?

I create a sample with the calculated column you provided .You can see the screenshot below .

Ailsamsft_0-1627280409090.png

From the data ,we can see the numbers for ProjectPhases[Remit Status]="Overdue" and ProjectPhases[Remit Status]="Due in 4 weeks" respectively are 2 and 1.Because I don’t know the field Projects[AuditCode] ,so I create the formulas are different from yours .

Then we create measures to count .

remit_overdue =
var cnt=CALCULATE(COUNTROWS(ProjectPhases),FILTER(ProjectPhases,ProjectPhases[Remit Status]="Overdue"))
return IF(cnt=BLANK(),0,cnt)
Remits_Due in 4weeks =
VAR cnt =CALCULATE(COUNT(ProjectPhases[Remit Status]),FILTER (ProjectPhases,ProjectPhases[actual_date_01]=BLANK() && NOW()>DATEADD(ProjectPhases[Remit_Target_Date],-28,DAY) && NOW()<ProjectPhases[Remit_Target_Date]))
return IF( cnt = BLANK(),0,cnt)

The result is as shown:

Ailsamsft_1-1627280409092.png

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @amitchandak 

Please correct me if I wrongly understood your problem.

You want to calculate the number of rows for ProjectPhases[Remit Status]="Overdue" and ProjectPhases[Remit Status]="Due in 4 weeks", right ?

I create a sample with the calculated column you provided .You can see the screenshot below .

Ailsamsft_0-1627280409090.png

From the data ,we can see the numbers for ProjectPhases[Remit Status]="Overdue" and ProjectPhases[Remit Status]="Due in 4 weeks" respectively are 2 and 1.Because I don’t know the field Projects[AuditCode] ,so I create the formulas are different from yours .

Then we create measures to count .

remit_overdue =
var cnt=CALCULATE(COUNTROWS(ProjectPhases),FILTER(ProjectPhases,ProjectPhases[Remit Status]="Overdue"))
return IF(cnt=BLANK(),0,cnt)
Remits_Due in 4weeks =
VAR cnt =CALCULATE(COUNT(ProjectPhases[Remit Status]),FILTER (ProjectPhases,ProjectPhases[actual_date_01]=BLANK() && NOW()>DATEADD(ProjectPhases[Remit_Target_Date],-28,DAY) && NOW()<ProjectPhases[Remit_Target_Date]))
return IF( cnt = BLANK(),0,cnt)

The result is as shown:

Ailsamsft_1-1627280409092.png

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , not sure for the reason to take min. Try measure like this one

 

COUNTX (
FILTER (
ProjectPhases,
ProjectPhases[remit status]
= "Overdue"
),
Projects[AuditCode]
) +0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.