Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I have the following table to show what I am trying to do, I'm looking to consolidate 3 different measures depending on whether it's a previous month, current month or future month. The switch Dax I've written (Sales Count Forecast TEST) seems to do what I need it to do, but as you can see the total is completely wrong for that column.
I've then seen solutions that suggest creating a summarization to correct this error and as you can see, the total for that column is correct but now Sep 2021 figure is wrong and then future months are showing as 0.
I have pasted my dax measures below, would anyone be able to kindly advise how to get that summarization looking the same as the "TEST" column albeit with the correct total.
Thanks in advance.
P.S apologies for the messy dax writing.
Sales Count = CALCULATE(
DISTINCTCOUNT('Base.Quotes&Sales'[AgreementID]),
'Base.Quotes&Sales'[ActionTypeID]=2)Sales Count Current Month Forecast 2 = INT(CALCULATE(DIVIDE([Sales Count Same Period Last Year]+[Sales Count Same Period 2 Yrs Ago]+[Sales Count Forecast Current Month],3,0)*(1+[Sales Count Year On Year Growth FLAT])))Sales Count Future Months Forecast = INT(CALCULATE(DIVIDE(([Sales Count Average 2]*[Days In Month])+[Sales Count Same Period Last Year]+[Sales Count Same Period 2 Yrs Ago],3,0)*(1+[Sales Count Year On Year Growth FLAT])))Sales Count Forecast TEST =
SWITCH(TRUE(),
SUM(RefCalendar[Previous Month])>0,[Sales Count],
SUM(RefCalendar[Current Month])>0,[Sales Count Current Month Forecast 2],
SUM(RefCalendar[Current Month])=0 && SUM(RefCalendar[Previous Month])=0,[Sales Count Future Months Forecast])Summarize Column = Var summarizedTable = ADDCOLUMNS(SUMMARIZE(RefCalendar,RefCalendar[MonthYearName]),"Forecast",[Sales Count Forecast TEST])
RETURN
SUMX(summarizedTable,[Forecast])
I've solved my own problem here, or at least @Greg_Deckler did.
I created a new measure,
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 9 | |
| 9 | |
| 8 |