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.
Dear All,
I got a salesman outlet visit data as MTD which is accumulated daily. How could I create new column or use DAX formula for salesman outlet daily visit? (calculation is outlet_visit_MTD(day n) minus outlet_visit_MTD(day n-1) by salesman) Here is example of the data below. I got the data from the 1st 3 columns and wish to create the 4th column.
Thank you in advanced!
Solved! Go to Solution.
Pay attention to the situation that there are gaps between dates.
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
hi @iteety ,
you may try to add a calculated column like:
Daily2 =
VAR _yyyymmdd = [yyyymmdd]
VAR _mtdpre =
CALCULATE(
MAX(data[MTD]),
ALLEXCEPT(data, data[SalesKey]),
data[yyyymmdd]< _yyyymmdd
)
RETURN [MTD]-_mtdpre
or
Daily3 =
VAR _yyyymmdd = [yyyymmdd]
VAR _saleskey = [saleskey]
VAR _mtdpre =
MAXX(
FILTER(
data,
data[saleskey]=_saleskey
&&data[yyyymmdd]<_yyyymmdd
),
data[MTD]
)
RETURN
[MTD] - _mtdpre
they worked like:
Pay attention to the situation that there are gaps between dates.
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |