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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Help with the complex DAX measure

I am struggling with a DAX measure. Here is the fact and 2 dimension tables I have:

 

 

 

 

factAction(dimAccountID, dimActionID, Date, ActionQty)
dimAction(dimActionID, ActionCode, ActionDescription)
dimDate(Date, WorkingDay)

 

 

 

 

The relationships are:

 

 

 

dimDate.Date -> factAction.Date
dimAction.dimActionID->factAction.dimActionID

 

 

 

And I have a DAX measure for ActionQty = SUM('factAction'[ActionQty])

We want to report on the number of actions of ActionCo

de AAA. Fine, that's easy. Just select ActionCode = AAA into the Power BI filter.

But now we want to also report, for those Accounts that had ActionCode AAA, the sum of ActionQty for ActionCode AAB where the ActionDate is within 2 working days of the AAA Action Date.

 

Any suggestions would be welcome!

 

Test data

AccountIDDateActionCodeActionQty
AC16 Apr 2020AAA1
AC19 Apr 2020AAB1
AC17 Apr 2020BBB1
AC216 Apr 2020AAA1
AC220 Apr 2020AAB1

 

Expected results

Filter AccountIDFilter Date (mmm YYYY)New measure expected resultReason
AC1Apr 20200Working days between AAA and AAB is > 2
AC2Apr 20201Working days between AAA and AAB is <= 2
3 REPLIES 3
Anonymous
Not applicable

Please check out the solution carefully.

 

Best

D

Anonymous
Not applicable

Hi. Please post some test data so that we can use it to create a solution. Best would be to have a PBI file but if you can't, then data in textual form will do. No pictures please. You can create tables here using the message's editing tools.

By the way, you've forgotten about the dimAccount table.

Best
D
Anonymous
Not applicable

Test data and expected results added to the original post.

No test data is needed for dimAccount, as nothing from that table is needed - simply the dimAccountID from factAction.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.