The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello.
I have a dataset where I am using a measure to calculate the latest inputed forecast by Rep, Product and Calendar Year/Month via a MAXX function a key date column.
The calculation is correct inside the matrix, but the total is wrong.
For example, the total latest forecast should be 210,000 but it's showing 60,000:
Please help edit the Forecast Selected measure so that the total shows up correctly in the total.
My test file is linked here: Link
Thanks!
PS. This same measure works with the original dataset. The dataset in the linked file is a summarized version of the original data table with validfromdate filtered and some irrelevant columns removed. Logically, this shouldn't have an ill affect on the matrix total. If anyone can explain why I am getting the wrong totals with this dataset, I'd appreciate it.
Solved! Go to Solution.
Hi @etane
Could you please follow below steps:
Sum of Amount = SUM ( Data[Amount] )
2.Naïve “latest forecast” (shows the total bug)
Forecast Selected (naive) =
VAR vLastDate =
CALCULATE ( MAX ( Data[Date] ), REMOVEFILTERS ( Data[Date] ) )
RETURN
CALCULATE ( SUM ( Data[Amount] ), Data[Date] = vLastDate )
Forecast Selected =
IF (
ISINSCOPE ( Data[Rep] ),
[Forecast Selected (naive)],
SUMX ( VALUES ( Data[Rep] ), [Forecast Selected (naive)] )
)
3.Build the matrix
Hi @etane please try this
Hello @techies .
I pasted the measure into the test app.
I find the measure is not picking up every rep's forecast such as Customer 004:
Hi @etane
Could you please follow below steps:
Sum of Amount = SUM ( Data[Amount] )
2.Naïve “latest forecast” (shows the total bug)
Forecast Selected (naive) =
VAR vLastDate =
CALCULATE ( MAX ( Data[Date] ), REMOVEFILTERS ( Data[Date] ) )
RETURN
CALCULATE ( SUM ( Data[Amount] ), Data[Date] = vLastDate )
Forecast Selected =
IF (
ISINSCOPE ( Data[Rep] ),
[Forecast Selected (naive)],
SUMX ( VALUES ( Data[Rep] ), [Forecast Selected (naive)] )
)
3.Build the matrix
@rohy . So, when one product is selected, the measure works because there's one max date per rep. However, when the product is not selected, the measure doesn't work because the max date only works on the product that has the latest date.
Could you please modify the measure so there's a max date not only by rep but also by product?
Thanks!
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
12 | |
9 | |
5 |