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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
avalonds
Frequent Visitor

Direct Query DAX Question

I’m currently using direct query to bring my dataset in powerbi.

 

I’m trying to create a measure in DAX such that the calculation is always done at a summarized view of the customer product level given a date context.

Here is an example. I have a sales table as noted below

Sales Table.PNG

If the user selects year 2020 and month 1, it computes the answer which is the sum of the (change in sales at a customer product level / Total prior year Sales). Hence regardless of any dimension attributes or selecting sales rep, this sum is always computed at the customer product level. In the case below the answer is -0.32203.

 

Answer.PNG

 

Can some help with this? See sample dataset attached. I believe the summarize dax function is not compatible with direct query. Hence looking for some other suggestion on measures.

Excel File Sample Data (same as above sales dataset in case link does not work)

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors