March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Harder than it looks: I have this simple table like below: I want to calculate how we're performing based on the goal in a Card. So I need to Sum only the goal values where the Gross Adds column is not blank(GAs are in the past and Goals are for the whole month). In theory this should work, but it puts a total for all the months previous rather than what is selected in the slicer. What's strange is if I replace [GAGoal] with [Gross Adds] in the measure below it correctly adds up the Gross Adds for the current month selected in the slicer.
GoalTotalCurrent = VAR LastDaySelection = LASTNONBLANK ( 'Calendar'[Calendar Date], [Gross Adds] ) VAR CurrentRange = DATESBETWEEN ( 'Calendar'[Calendar Date], MIN ('Calendar'[Calendar Date] ), LastDaySelection ) RETURN IF ( LastDaySelection >= MIN ( 'Calendar'[Calendar Date]),CALCULATE ( [GAGoal], CurrentRange ))
I've tried things like this, but it results in blank:
SumGoals = IF(SUMX('Subscriber Activity',[Gross Adds])<>Blank(),SUMX('Subscriber Activity',[GAGoal]))
So it shouldn't sum 1/8,1/9,or1/10
Date | Goal | Gross Adds |
1/1/2025 | 5 | 6 |
1/2/2025 | 7 | 5 |
1/3/2025 | 8 | 7 |
1/4/2025 | 7 | 7 |
1/5/2025 | 4 | 3 |
1/6/2025 | 3 | 2 |
1/7/2025 | 2 | 1 |
1/8/2025 | 5 | |
1/9/2025 | 5 | |
1/10/2025 | 5 |
You seem to be using a calculated column. Probably what you wanted to do was a measure.
@lbendlin Hi. I'm using a measure. [GAGoal] is a measure, so I have to use SUMX, so I tried your formula like this and get "A function placeholder has been used in a true/false expression...":
var md=MAX('Calendar'[Calendar Date])
return CALCULATE(SUMX('Subscriber Activity',[GAGoal]),'Calendar'[Calendar Date]<=md,NOT isblank('Subscriber Activity'[Gross Adds]))
I got the formula below to work in the rows. It only shows the goal in each row where there is a corresponding entry in Gross Adds. These add up to like 3,000. But the total at the bottom shows 93,000. ???? So when I put the measure in a card it shows the total of 93k instead of 3000. What is going on?
SumGoalslessThanDate =
Var GAGoalCalc = CALCULATE([GAGoal])
Return
Calculate(Sumx('Calendar',GAGoalCalc),filter('Calendar','Calendar'[Calendar Date]<=LASTNONBLANK('Calendar'[Calendar Date],[Gross Adds])&& 'Calendar'[Calendar Date]>=min('Calendar'[Calendar Date])))
On your file Goal is a column whereas I have Goal as a measure. Anyhow I'm getting this error when I use the formula you presented: "A function placeholder has been used in a true/false expression...": Any way around that? Your PBIX does exactly what i need, I just don't know how to make it work in this model.
I figured out that the total in the card is coming from it summing the total goal for each day that the amount appears in the the date. 7 * 13k. Just don't know how to fix it? Each row is correct, but it's the sum that's off.
remember that in a table visual measures are calculated twice, once for the rows and once for the row total. You can choose "MAX" for the aggregation, or use HASONEVALUE / ISINSCOPE to modify the measure behavior according to where you are in the visual.
I simplified the measure, and now the sum total is correct for the whole month. But this isn't what I was wanting-Need to just add the numbers that are visible. I don't think this works for a measure? If you modify the PBIX to calculate GAGoal in a measure like [PreviousYearGrossAdds]/[PYGAsAll]*[LocQuota], you'Il see what I'm talking about. I've tried many different purmutations with all nearly the same result:
GoalLessthanDate = IF([Gross Adds]<>Blank(),( [PYGA]/[PYALLGAs])*[LocQuota1])
I even used the exact same code that works here: Why Power BI totals might seem inaccurate - SQLBI But they must be calculating on columns and not measures? There would have to be a different approach to make this work. Please help.
If you modify the PBIX to calculate GAGoal in a measure like [PreviousYearGrossAdds]/[PYGAsAll]*[LocQuota], you'Il see what I'm talking about
Very much not recommended. Especially for troubleshooting you don't want to nest measures. Write your business logic out verbatim. Only reference measures if you are confident about the result and are willing to absorb the cost of the extra context transitions.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
17 | |
16 | |
6 | |
5 |
User | Count |
---|---|
29 | |
25 | |
20 | |
13 | |
10 |