Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
I have the following problem and i need some advice.
I would like to create the following:
Partner - last sales date - last sale amount - AVG sales by partners
1 - 2021.08.20 - 7000 - 2430
2 - 2021.08.22 - 6500 - 3000
I have the partner and the last sales date, but cant figure it out how to put the rest 2 columns
My tables:
One table that countains all documents, sales deliveris etc, with dates, and partner datas.
ID - PartnerID - Fullfillmentdate - Type - Amount
1 - 1 - 2021.07.01 - Sale - 4500
2 - 1 - 2021.08.20 - Sale - 7000
3 - 2 - 2021.08.10 - Sale - 100
4 - 2 - 2021.08.22 - Sale - 600
5 - 2 - 2021.08.22 - Sale - 6500
On the same day there could be more sales and i need the last one by table ID, and fullfillmentdate.
Solved! Go to Solution.
@Akos07 , Please try a measure like
Measure =
VAR __id = MAX ('Table'[PartnerID] )
VAR __date = CALCULATE ( MAX('Table'[Fullfillmentdate] ), ALLSELECTED ('Table' ), 'Table'[PartnerID] = __id )
CALCULATE ( sum('Table'[Amount] ), VALUES ('Table'[PartnerID ] ),'Table'[PartnerID] = __id,'Table'[Fullfillmentdate] = __date )
or
calculate(lastnonbalnkvalue('Table'[Fullfillmentdate] ,sum('Table'[Amount])), filter(allselected('Table'), 'Table'[PartnerID] = max('Table'[PartnerID])))
@Akos07 , Please try a measure like
Measure =
VAR __id = MAX ('Table'[PartnerID] )
VAR __date = CALCULATE ( MAX('Table'[Fullfillmentdate] ), ALLSELECTED ('Table' ), 'Table'[PartnerID] = __id )
CALCULATE ( sum('Table'[Amount] ), VALUES ('Table'[PartnerID ] ),'Table'[PartnerID] = __id,'Table'[Fullfillmentdate] = __date )
or
calculate(lastnonbalnkvalue('Table'[Fullfillmentdate] ,sum('Table'[Amount])), filter(allselected('Table'), 'Table'[PartnerID] = max('Table'[PartnerID])))
The 2. option does the trick, thanks.
User | Count |
---|---|
84 | |
81 | |
64 | |
53 | |
45 |
User | Count |
---|---|
100 | |
48 | |
41 | |
39 | |
38 |