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 August 31st. Request your voucher.
I've created a calculation group "Periods" in tabular model using visual studio, this calculation group have one calculation item called PY , with this formula ( for test purpose ) :
var Formula=calculate(SELECTEDMEASURE(),'FISCAL YEAR'[FISCAL_YEAR]="2023")
return Formula
When I've deployed the model in a power bi premium capacity everything goes fine. If I used the calculation item in a measure, the filter doesn't work. I discover that the problem is related to empty calculation group table. I've alredy done a full process of this table.
Using dax studio with this statement : evaluate Periods rise an errror because the table is empty
Solved! Go to Solution.
It's necessary do run a process recalc, and the calculation group works only in reference to a measure not to a base farmula like sum(column )
It's necessary do run a process recalc, and the calculation group works only in reference to a measure not to a base farmula like sum(column )
It works only if I filter the calculation item in the visual, but It filter also other measures.
First question why you harded coded the value of the year instead of using SAMEPERIODLASTYEAR(<dates>)?
and could you share the model diagram to understand how is everything is communicating ?
I've tried sameperiodlastyear, but to isolate the issue I've changed the formula.
Hi @sambias - Deploy the updated model to Power BI Premium and use the calculation group in a matrix or table visual.
If applying the "PY" calculation item still doesn’t show results, ensure:
PY = CALCULATE(SELECTEDMEASURE(), 'FISCAL YEAR'[FISCAL_YEAR] = "2023")
If you're still facing issues even after isolating the formula and testing with a basic calculation, the problem might not be with the formula itself but rather with how calculation groups interact with the model or filters.
Proud to be a Super User! | |
I tried to simplify the model as much as possible, but the problem is still there.
The model now have only one table ( in order to isolate the issue )
only 1 table :
measure test :
calculate(sum(RETAIL[NET_QUANTITY]),Calc[Group]="TEST")
If I use the measure in a simple query, value aren't filtered, but If I write the same dax code , withous using calculation group, value are calculated correctly. I've done a process recalc ( and also a full process ) for the entire model.