Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All,
I have created a Power BI report connecting to a fact table using the direct query. The tables contain data from 2019. For the purpose of my visuals, I have filtered the table using the below M query.
= Table.SelectRows(ft_transactions, each Date.IsInCurrentMonth( [inv_date] ) or Date.IsInPreviousNMonths([inv_date], 2) )
Then I created a calculated table using the below dax, for the underline fact table For the purpose of improving the report performance.
Current month Sales=
SUMMARIZE (
ALL ( 'ft_transactions'[define date],'ft_transactions'[product_code],'ft_transactions'[product_category],'ft_transactions'[prd_desc]),
'ft_transactions'[define date], 'ft_transactions'[product_code],'ft_transactions'[product_category],'ft_transactions'[prd_desc],
"Total Sales Value", SUMX('t_transactions',[actual ach] ),
"Total Sales Volume", SUM('t_transactions'[actual vol]))
** define date is a calculater col that gives first date of each month.
But the issue is, I'm getting this error as the row count exceeds 1M for the underline table.
The resultset of a query to external data source has exceeded the maximum allowed size of '1000000'
Can anyone suggest a work around to overcome this issue.
@user_dil , Are you using direct query mode ?
Also for current month previous month sue time intelligence measures
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
or measure like
MTD Today =
var _min = eomonth(today(),-1)+1
var _max = today()
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
LMTD Today=
var _min = eomonth(today(),-2)+1
var _max1 = today()
var _max = date(year(_max1),month(_max1)-1, day(_max1))
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
LYMTD Today =
var _min = eomonth(today(),-13)+1
var _max1 = today()-1
var _max = date(year(_max1)-1,month(_max1), day(_max1))
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
MTD Yesterday =
var _max = today() -1
var _min = eomonth(_max,-1)+1
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
This Month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
Last Month Today =
var _min = eomonth(today(),-2)+1
var _max = eomonth(today(),-1)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
yes, but creating measures directly from the fact table makes the visuals loading slow. That's the reason I used SUMMARIZE function to create calculated table.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
62 | |
61 | |
55 | |
38 | |
27 |
User | Count |
---|---|
85 | |
60 | |
45 | |
41 | |
39 |