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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mmoeller
Regular Visitor

Date Range Look-up in M

Hi, 

 

I'd like to implement a Date Range Look-Up in M.  I know how to do this in DAX and have succesfully built it there using this code:

 

ComplianceLocation = CALCULATE(VALUES(AssignedLocations[LocInput]),FILTER(AssignedLocations, AssignedLocations[PID]='MeetingCompliance'[PID] && AssignedLocations[EndDate]>MeetingCompliance[MonthDate] && AssignedLocations[StartDate]<MeetingCompliance[MonthDate]))

 

However, then I have to implement a dynamic pivot, which is only available in M (it seems DAX only allows rigid pivots with known values).

 

So, my problem can be solved one of two ways.  How would I do same thing this DAX code does but in M or how do I pull a DAX column into the Query Editor to use M on it?

2 REPLIES 2
dax
Community Support
Community Support

Hi @mmoeller ,

We couldn't use DAX in M code directly, If you want to find range date and filter corresponding value based on other table, I think you might need to merge two table to see whether it work or not, Or try to use parameter to achieve this goal. If possible could you please inform me more detailed information(such as your expected output and your sample data (by OneDrive for Business))? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

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

 

edhans
Super User
Super User

This is probably pretty easy to do, but very difficult without sample data tables to play with along with the expected ouput. I understand what your DAX measure is doing but I don't know what those fields or tables look like.

 

DAX doesn't pivot data really. DAX is for analysis. Power Query is for modeling. 

 

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors