Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
please anyone help me to solve following issue.
I have two tables (see also screens):
Expected outcom is to have a third table, SALES_TOTAL, with aggregated monthly sales per customer, where current month's figures will adjust when SALES_CURRENT_MNTH table is refreshed.
Thanks for an advice! 🙂
Solved! Go to Solution.
Hi @Pio_Mat
Would something like this help?
_SummaryTable =
VAR _Table =
SUMMARIZE(
'SALES_CURR_MTH',
'SALES_CURR_MTH'[CustomerID],
"Year-month",
VAR _Dt = MIN( 'SALES_CURR_MTH'[Date] )
VAR _Yr = YEAR( _Dt )
VAR _Mon = MONTH( _Dt )
RETURN
DATE( _Yr, _Mon, 1),
"Sales",
SUM( 'SALES_CURR_MTH'[Sales] )
)
RETURN
UNION(
'SALES_PREV_MTHS',
SELECTCOLUMNS(
_Table,
"Year-month",
[Year-month],
"CustomerID",
[CustomerID],
"Sales",
[Sales]
)
)
Hi @Pio_Mat
Would something like this help?
_SummaryTable =
VAR _Table =
SUMMARIZE(
'SALES_CURR_MTH',
'SALES_CURR_MTH'[CustomerID],
"Year-month",
VAR _Dt = MIN( 'SALES_CURR_MTH'[Date] )
VAR _Yr = YEAR( _Dt )
VAR _Mon = MONTH( _Dt )
RETURN
DATE( _Yr, _Mon, 1),
"Sales",
SUM( 'SALES_CURR_MTH'[Sales] )
)
RETURN
UNION(
'SALES_PREV_MTHS',
SELECTCOLUMNS(
_Table,
"Year-month",
[Year-month],
"CustomerID",
[CustomerID],
"Sales",
[Sales]
)
)
Thank you, @gmsamborn ,
after some small adjustments to my 'real' environment I got exactly what I was looking for.
Thank you so much!
🙂
Hi @Pio_Mat in two tables, according to picture, there are different grain of granularity of data: mix monthly and daily level. My personal experience: the best is to have it on single level like on daily as it is easier to aggregate it on monthly / yearly level...
When you analyse your possibilities and next steps please check link how to do as possible example in Power Query on link below. Depending on your analysis maybe some other type of query would be needed in Power Query, but most probably Power Query is your best option.
https://learn.microsoft.com/en-us/power-query/append-queries
Did I answer correctly? Kudos appreciate / accept solution.
Proud to be a Super User!
Thank you, @some_bih !
My idea was more like to find a way to calculate cumulated current month's sales per customer from a table SALES_CURR_MTH and then, having data with the same granularity as in SALES_PREV_MTHS, union both?
My intuition says it should be doable but I am to new in DAX to find a way how to do that 🙂
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
90 | |
81 | |
65 | |
65 | |
61 |
User | Count |
---|---|
170 | |
114 | |
102 | |
73 | |
69 |