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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
pmadam
Helper II
Helper II

DAX Help

How do i acheive below condition in DAX measure.

 

Functionality.jpg

 

 

 

 

 

 

BusDay is from one table and remaining dates come from different table.In between these two tables there is one active relationship between order date and busday and remainig two values are inactive relationships with Busday.

 

Thanks,

Prathy

1 ACCEPTED SOLUTION

@pmadam 

Try

Test =
countx(summarize(filter(all('DailySnapshot'),'DailySnapshot'[col_OrderDate] <=max ('BusinessCalendar'[col_Date]) && 'DailySnapshot'[col_StartDate] <=max('BusinessCalendar'[col_Date]) && 'DailySnapshot'[col_EndDate]>=max('BusinessCalendar'[col_Date])), 'DailySnapshot'[Order-Line]),[Order-Line])
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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@pmadam ,

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

You can actually make it work like

New Measure =
countx(summarize(filter(table,table[order_date]<=max(Table2[Bus Day]) && Table[start date]<=max(Table2[Bus Day])
&& Table[end date]>=max(Table2[Bus Day])), Table[Order-Line]),[Order-Line])

 

As we need an aggregated column from another table in the measure we can use related /min /max depend on the relation.

Order -line is force the row context of like , there can be more group bys

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

 
Thankyou so much for your reply.
 
I have created below measure as mentioned and added in below visual. It gives me blank data
 
Test =
countx(summarize(filter('DailySnapshot','DailySnapshot'[col_OrderDate] <=max ('BusinessCalendar'[col_Date]) && 'DailySnapshot'[col_StartDate] <=max('BusinessCalendar'[col_Date]) && 'DailySnapshot'[col_EndDate]>=max('BusinessCalendar'[col_Date])), 'DailySnapshot'[Order-Line]),[Order-Line])
 
Reply.jpg

@pmadam 

Try

Test =
countx(summarize(filter(all('DailySnapshot'),'DailySnapshot'[col_OrderDate] <=max ('BusinessCalendar'[col_Date]) && 'DailySnapshot'[col_StartDate] <=max('BusinessCalendar'[col_Date]) && 'DailySnapshot'[col_EndDate]>=max('BusinessCalendar'[col_Date])), 'DailySnapshot'[Order-Line]),[Order-Line])
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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors