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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Dax query for dates from different unrelated tables

Hi @Greg_Deckler  I have created a dax measure in power bi but it made the performance of the report very slow. I have two unrelated tables A and table B with dates and I have to get the sum of sales from table A where table A date(month,year) = table B (month,year). So I have created below dax measure

 

measure = calculate(sum(sales), filter(table A, month(table A) = month(table B)), filter(table A, year(table A) = year(tableB))

 

measure works fine. But the performance became very slow after getting this measure into the matrix. Please suggest

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , ideally Create a common date table and filter both using the date table aulte

 

M1 = countrows(tableb)

 

M2 = Sum(TableA[Value])

 

M3 = sumx(filter( Values(Date[Date]) , not(Isblank([M1]))) , [M2])

 

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solution-8e3eccb41bda

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors