Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Hi friends,
i have a dataset with date, storekey, revenue, quantity, revenue_target, Quantity_target.
I need you help to create a new table inside PowerBI that contain all of measure including actual, MTD, YTD,Lastmonth values with date and storekey are dimension , i tried many times with few functions like sumarize() or addcolumn() but the values for MTD and YTD are always wrong or null.
Coud anyone help me or give your advices on this situation?
I could share my dataset as link:
https://www.dropbox.com/s/bt4c7z90zp4dys4/test.pbix?dl=0
Thank in advanced,
J.
Solved! Go to Solution.
Hi @michaelJack,
You can create a calculated table below:
Test_Sumarize = SUMMARIZE(
Revenue,
Revenue[StoreKey],
Revenue[OrderDate],
"Revenue_act",SUM(Revenue[Revenue]),
"Revenue_act_MTD",CALCULATE(SUM(Revenue[Revenue]),FILTER(ALL(Revenue),'Revenue'[OrderDate]<=MAX(Revenue[OrderDate]) && MONTH('Revenue'[OrderDate])=MONTH(MAX(Revenue[OrderDate])) && YEAR(Revenue[OrderDate])=YEAR(MAX(Revenue[OrderDate])))),
"Revenue_act_YTD",CALCULATE(SUM(Revenue[Revenue]),FILTER(ALL(Revenue),'Revenue'[OrderDate]<=MAX(Revenue[OrderDate]) && YEAR(Revenue[OrderDate])=YEAR(MAX(Revenue[OrderDate]))))
)
You can see attached pbix file.
Best Regards,
Qiuyun Yu
Hi @michaelJack,
You can create a calculated table below:
Test_Sumarize = SUMMARIZE(
Revenue,
Revenue[StoreKey],
Revenue[OrderDate],
"Revenue_act",SUM(Revenue[Revenue]),
"Revenue_act_MTD",CALCULATE(SUM(Revenue[Revenue]),FILTER(ALL(Revenue),'Revenue'[OrderDate]<=MAX(Revenue[OrderDate]) && MONTH('Revenue'[OrderDate])=MONTH(MAX(Revenue[OrderDate])) && YEAR(Revenue[OrderDate])=YEAR(MAX(Revenue[OrderDate])))),
"Revenue_act_YTD",CALCULATE(SUM(Revenue[Revenue]),FILTER(ALL(Revenue),'Revenue'[OrderDate]<=MAX(Revenue[OrderDate]) && YEAR(Revenue[OrderDate])=YEAR(MAX(Revenue[OrderDate]))))
)
You can see attached pbix file.
Best Regards,
Qiuyun Yu
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
104 | |
69 | |
48 | |
41 | |
34 |
User | Count |
---|---|
164 | |
112 | |
62 | |
54 | |
38 |