The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
111 | |
80 | |
78 | |
43 | |
37 |
User | Count |
---|---|
158 | |
111 | |
64 | |
59 | |
54 |