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 model with 1 fact f1 and 3 dims d1, d2, d3.
Fact has pre aggregated data and so all measures aggregationtype = none. There's a dummy measure RowCount.
I'm trying to achieve following in a table row:
d1 attribute,d2 attribute ,d3 attribute ,09/11/2020, non additive measure value, non addtivive measure value on 09/10/2020
So basically overwriting the row context of date with a date from previous month. If the measure was additive, its relatively straightforward with calculate, values and remove filters expression but in this case the measure is non additive.
Volume of fact data is huge so doing table join onto itself in M is not possible. So in dax, if there's a way to traverse date column back a month but with current row filters to create a calculated column would be ideal. Is this possible?
Thanks
@RakeshSinghr , the measure is pre-aggregated, are talking about column or Measure?
Its a percentage column, so a non additive measure with aggregation type = none in dataset.
by pre-aggregated i was referring to the values being precalculated in datasource table already.
So can't be used as a measure in dax expressions.
@RakeshSinghr , No very clear you can try measure like
measure1 =
var _date = maxx(allselected(Date),date[date])
return
calculate([measure], filter(Date, Date[date] =_max))
//calculate([measure], _max)
last month =
var _date1 = maxx(allselected(Date),date[date])
var _date = date(year(_date), month(_date)-1,day(_date))
return
calculate([measure], filter(Date, Date[date] =_max))
or measure like
MTD Sales = CALCULATE([measure],DATESMTD('Date'[Date]), filter('Date','Date'[Date]=max('Date'[Date])))
last MTD Sales = CALCULATE([measure],DATESMTD(dateadd('Date'[Date],-1,MONTH)), filter('Date','Date'[Date]=max('Date'[Date])))
@amitchandak - Thanks for the response.
Only issue is that the measure's aggregation type = none and so cannot have that field inside of calculate (measures,..) ?
User | Count |
---|---|
18 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
12 | |
9 | |
8 |