| FIRST CREATED ON 11 Aug 2025 I AUTHOR Emma Camacho |
Creating
an Word report using a PowerBI as a data source in Mail & Deploy
allows you to leverage powerful data analysis capabilities. Here's an
example to help you get started:
Use case
Design a Store Analysis Report for a specific Store.
Mail & Deploy Report
The output Report looks like this:
How to get there?
PowerBI Server Database datasource
How to configure a PowerBI Datasource in version 3.6 and higher?
Datasource definition
Report Template
The template is attached to this article.
PARAMETERS
Datasource
"M&D Demo_Sales & Returns Sample v201912"
This is the name of the Datasource used in the M&D Datasource definition and it is used to ease the use of the function EvaluateDaxOrDmvDatasourceExpression.
Store
"Contoso"
This is the parameter that defines the Store to be filtered to.
ELEMENTS
NetSales
format( EvaluateDaxOrDmvDatasourceExpression( [ReportParameter].[Datasource], "EVALUATE { CALCULATE([Net Sales],Store[Store]="""&[ReportParameter].[Store] &""")}", 0 ), "$ ##,##0" )
Units Sold
format( EvaluateDaxOrDmvDatasourceExpression( [ReportParameter].[Datasource], "EVALUATE { CALCULATE([Units Sold],Store[Store]="""&[ReportParameter].[Store] &""")}", 0 ), "$ ##,##0" )
Category Breakdown
Source: DAX/DMV Query
Query Datasource: M&D Demo_Sales & Returns Sample v201912
Query: "EVALUATE " &
" CALCULATETABLE( " &
" SUMMARIZECOLUMNS( 'Product'[Product] , ""Net Sales"", [Net Sales] ) ,Store[Store]=""" &[ReportParameter].[Store]& """) ORDER BY [Net Sales] ASC "
Insertion Mode: Fill MSO Chart
Returns
format( EvaluateDaxOrDmvDatasourceExpression( [ReportParameter].[Datasource], "EVALUATE { CALCULATE([Returns],Store[Store]="""&[ReportParameter].[Store] &""")}", 0 ), "$ ##,##0" )
Units Returned
format( EvaluateDaxOrDmvDatasourceExpression( [ReportParameter].[Datasource], "EVALUATE { CALCULATE([Units Returned],Store[Store]="""&[ReportParameter].[Store] &""")}", 0 ), "$ ##,##0" )
Return Breakdown
Source: DAX/DMV Query
Query Datasource: M&D Demo_Sales & Returns Sample v201912
Query: "EVALUATE " &
" CALCULATETABLE( " &
" SUMMARIZECOLUMNS( 'Product'[Product] , ""Returns"", [Returns] ) ,Store[Store]=""" &[ReportParameter].[Store]& """) ORDER BY [Returns] ASC "
Insertion Mode: Fill MSO Chart
Today
Date.Now.Tostring("dd.MM.yyyy")