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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Dunner2020
Post Prodigy
Post Prodigy

Converting dax measure into column in power Query

Hi there,

 

I have a dax measure which looks like as follow:

 

No days notice given directly to consumers = 
VAR retail_notify = INT ( MAX ( 'FactTable'[Retail Consumer Direct Notify] ) )
VAR Event_start =INT (MAX ( 'FactTable'[Actual Event Start Time] ) )
VAR Event_type = MAX ( 'FactTable'[EventType] ) 
VAR varDaycount =
IF (
Event_type = "2"
&& YEAR ( retail_notify ) > 1900
&& NOT ( ISBLANK ( retail_notify ) ),
 
COUNTROWS (
FILTER (
ALL ( Dates[Date], Dates[IsHoliday], Dates[Day Of Week Name] ),
Dates[Date] >= retail_notify
&& Dates[Date] <= Event_start
&& Dates[IsHoliday] = FALSE ()
&& Dates[Day Of Week Name] <> "Saturday"
&& Dates[Day Of Week Name] <> "Sunday"
)
)
)
RETURN
varDaycount

 

I wanted to convert the above dax measure into a facttable column using Power Query lanugage. I could not figure out how should I calculate the difference between two dates by exluding few conditions (such as weekends) in power query. Any help would be really appreciated

 

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi, @Dunner2020 

If possible ,please share your  tables ( 'FactTable' and 'Dates') or sample pbix file (enter data) for testing.

 

Best Regards,
Community Support Team _ Eason

 

lbendlin
Super User
Super User

It is fundamentally impossible to convert a measure into a column, regardless if Power Query or not. Measures are impacted by user interactions, columns are immutable.

 

If your "No days notice given directly to consumers " calculation does not depend on user interaction then you can recreate it as a column in DAX with only some minor code changes. What is your rationale for wanting this in Power Query?

Yes, "No days notice given directly to consumers " does not depend upon user interaction.  I was calling this measure into many measures and it is causing a lot of delays, converting into a column would (hopefully) reduce the computational time. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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