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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Export the result of dax as a new table

Hi 

 

I have some data and I have built many DAX measures for different analysis on them. I want to export the results of my measures into a new table in a monthly basis. The following is a simple working example:

 

raw data:

 

datesale
2020-01-151
2020-01-195
2020-01-212
2020-01-294
2020-02-012
2020-02-042
2020-02-063
2020-02-145
2020-02-191
2020-02-252
2020-03-016
2020-03-051
2020-03-104
2020-03-205
2020-03-252
2020-04-013
2020-04-102
2020-04-154
2020-04-192
2020-04-259

 

Now, imagine I have a DAX measure to sum sale per month (SUM(raw[sale]). I want to output the result of this measure into a new table and each row represents one month (for example start of month is good for me):

 

output table:

 

start of monthsum of sale
2020-01-0112
2020-01-0215
2020-01-0318
2020-01-0420

 

How can I do such export into a new table?

Thanks.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , pbix with date table  . Table 2 ( From Table and Date) . Table 2 ( From Table and Date) 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can use the following calculated table based on your sample data:

 

table2 = SUMMARIZE(SELECTCOLUMNS('Table',"start of month",DATE(YEAR('Table'[date]),MONTH('Table'[date]),1)),[start of month],"sum of sales",CALCULATE(SUM('Table'[sale]), FILTER('Table',MONTH('Table'[date])= MONTH([start of month])&&YEAR('Table'[date])=YEAR([start of month]))))

 

Capture1.PNG

 

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

 

Best Regards,

Dedmon Dai

amitchandak
Super User
Super User

@Anonymous , pbix with date table  . Table 2 ( From Table and Date) . Table 2 ( From Table and Date) 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@Anonymous , New table

 

SUMMARIZE(SELECTCOLUMNS('Table',"Month" , EOMONTH('Table'[date],-1)+1 , "Sales",SUM('Table'[sale])),[Month],"sales",SUM('Table'[sale]))

 

Try two table

 

Table 3 = SELECTCOLUMNS('Table',"Month", EOMONTH([date],-1)+1, "sale",'Table'[sale])

Table 4 = SUMMARIZE('Table 3','Table 3'[Month],"sales",SUM('Table 3'[sale]))

 

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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