Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Desired result: get sum of Sales by workdays (sum of monthly diff) = 129,496 instead of 196,024.74
Background: trying to get the grand total sum of monthly difference between the average of sales by workdays. Have figured out all the parts including getting grand total of averages but it does not work with month;y differences. Ruled out hasonevalue as it works fine with sum of averages.
Thanks to the community help, I am confident about getting the sum of averages from this previous post. Don't know how to troubleshoot the sum of diff of avgs though.
Details
DIVIDE( SUM(financials[Sales]), [Num Of Workdays] )
IF (
HASONEVALUE ( 'Date'[Month Year] ),
[Sales by Workdays (avg)],
SUMX ( VALUES ( 'Date'[Month Year] ), [Sales by Workdays (avg)] )
)
CALCULATE( financials[Sales by Workdays (avg)], PREVIOUSMONTH( 'Date'[Date] ) )
financials[Sales by Workdays (avg)] - financials[Sales by Workday (avg prev month)]
var x = [Sales by Workday (monthly diff)]
Return
IF( HASONEVALUE( 'Date'[Month Year] ), x,
SUMX( VALUES( 'Date'[Month Year] ), x )
)
Solved! Go to Solution.
Hi @VinhTon ,
Please simply use:
Sales by Workdays (sum of monthly diff) = SUMX(VALUES('Date'[Month Year]),[Sales by Workday (monthly diff)])
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @VinhTon ,
Please simply use:
Sales by Workdays (sum of monthly diff) = SUMX(VALUES('Date'[Month Year]),[Sales by Workday (monthly diff)])
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks you!
Hi @VinhTon ,
You may try :
Measure =
var _t= SUMMARIZE(ALLSELECTED(financials),financials[Month Year],"sum",[Sales by Workday (monthly diff)])
return IF(HASONEVALUE(financials[Month Year]) ,[Sales by Workday (monthly diff)], SUMX(_t,[sum]))
If it still not work , please share me with your pbix file after removing sensitive data. Refer to:
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You could try
Sales by Workdays (sum of monthly diff) =
IF( ISINSCOPE( 'Date'[Month Year]), [Sales by Workday (monthly diff)],
SUMX( VALUES('Date'[Month Year]), [Sales by Workday (monthly diff)] )
)
Also gives 196,024
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |