Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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,
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |