The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I have a calculation for delta-values for subgroups that is fine within each group - however whenever there is a new subgroup the calculation is not able to differentiate,
How would I manange the calculation to handle the in between subgroups as well?
Where the calculation sasys 9.936.002 I would like to have zero - since the next line is a new subgroup (column "MeterTagID"),
Data_P16 =
var _nextvalue=
CALCULATE(SUM('DataLog_P16'[Data]),FILTER('DataLog_P16',[Indeks]=EARLIER('DataLog_P16'[Indeks.1])))
var _data=
_nextvalue-[Data]
return IF(_nextvalue=BLANK(),BLANK(),_data)
Solved! Go to Solution.
@Anonymous You need to add meter tag matching:
Data_P16 =
var _nextvalue=
CALCULATE(SUM('DataLog_P16'[Data]),FILTER('DataLog_P16', [MeterTagID] = EARLIER('DataLog_P16'[MeterTagID]) && [Indeks]=EARLIER('DataLog_P16'[Indeks.1])))
var _data=
_nextvalue-[Data]
return IF(_nextvalue=BLANK(),BLANK(),_data)
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@Anonymous , Try like
Data_P16 =
var _nextvalue=
CALCULATE(SUMX(FILTER('DataLog_P16',[Indeks]=EARLIER('DataLog_P16'[Indeks.1] && [MeterTagID]=EARLIER('DataLog_P16'[MeterTagID]), 'DataLog_P16'[Data])))
var _data=
_nextvalue-[Data]
return IF(_nextvalue=BLANK(),BLANK(),_data)
@Anonymous You need to add meter tag matching:
Data_P16 =
var _nextvalue=
CALCULATE(SUM('DataLog_P16'[Data]),FILTER('DataLog_P16', [MeterTagID] = EARLIER('DataLog_P16'[MeterTagID]) && [Indeks]=EARLIER('DataLog_P16'[Indeks.1])))
var _data=
_nextvalue-[Data]
return IF(_nextvalue=BLANK(),BLANK(),_data)
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com