I have two tables in SSAS that have one column for Budget, another table with Accomplished, and another table that has the list of branches.
I need to create a measure that aggregates the sum for each branch, compare if the goal has been exceeded, if so, check TRUE if not as FALSE.
Solved! Go to Solution.
Hi @v-juanli-msft, this solution is great! But I'm having trouble to count the booleans.
It may have something to do because the budgets, accomplish, and branch tables are separate in the data model.
My formulas:
Sum Budget:= CALCULATE(SUM(Budget[Budget]);ALLEXCEPT(Branches;Branches[abbrevbranches]))
Sum Accomplish:=CALCULATE(SUM(Accomplished[Accomplished]);ALLEXCEPT(Branches;Branches[abbrevbranches]))
Deviation:=IF([Sum Budget] > [Sum Accomplish];"TRUE";"FALSE")
Total True:=CALCULATE(DISTINCTCOUNT(Branches[abbrevbranches]);FILTER(ALL(Accomplished);Accomplished[Deviation]="TRUE"))
Total False:=CALCULATE(DISTINCTCOUNT(Branches[abbrevbranches]);FILTER(ALL(Accomplished);Accomplished[Deviation]="FALSE"))
Total branches:=CALCULATE(DISTINCTCOUNT(Branches[abbrevbranches]);ALL(Accomplished))
Percentage:=DIVIDE([Total True];[Total branches])
Finally I did, it was necessary to change two more formulas:
Count FALSE:= COUNTROWS(FILTER(DISTINCT(Filiais[SiglaFiliais]);[Deviation]="FALSE")) Count TRUE:= COUNTROWS(FILTER(DISTINCT(branches[abbrevbranches]);[Deviation]="TRUE"))
The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!
Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.
User | Count |
---|---|
329 | |
164 | |
70 | |
67 | |
48 |