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 tried hard to work with Copilot to come up with the proper measure, but I'm turning to real people for help now.
I have a transactions table:
EpargnantSource_Code DateReport_Date Montant
C001 | 20 septembre 2024 | 300 | ||||||||
C001 | 10 octobre 2024 | 200 | ||||||||
C002 | 15 octobre 2024 | 150 | ||||||||
C003 | 25 décembre 2024 | 400 | ||||||||
C001 | 10 novembre 2024 | 250 | ||||||||
C003 | 15 janvier 2025 | 350
And a telemarketing table listing calls made to those clients:
EpargnantSource_codecreatedon
|
Solved! Go to Solution.
SommeTransactionsApresAppel := //Try this
VAR NbJours =
SELECTEDVALUE('NB_jours_télémarketing'[NB_jours_télémarketing Value], 30)
RETURN
SUMX (
'Télémarketing',
VAR DateAppel = 'Télémarketing'[createdon]
VAR CodeClient = 'Télémarketing'[EpargnantSource_code]
RETURN
CALCULATE (
SUM ( TransactionEpargnant[Montant] ),
FILTER (
TransactionEpargnant,
TransactionEpargnant[EpargnantSource_Code] = CodeClient &&
TransactionEpargnant[DateReport_Date] > DateAppel &&
TransactionEpargnant[DateReport_Date] <= DateAppel + NbJours
)
)
)
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
Works great. What did the ,30 add to the selectedvalue ?
It'S basically the default value?
SommeTransactionsApresAppel := //Try this
VAR NbJours =
SELECTEDVALUE('NB_jours_télémarketing'[NB_jours_télémarketing Value], 30)
RETURN
SUMX (
'Télémarketing',
VAR DateAppel = 'Télémarketing'[createdon]
VAR CodeClient = 'Télémarketing'[EpargnantSource_code]
RETURN
CALCULATE (
SUM ( TransactionEpargnant[Montant] ),
FILTER (
TransactionEpargnant,
TransactionEpargnant[EpargnantSource_Code] = CodeClient &&
TransactionEpargnant[DateReport_Date] > DateAppel &&
TransactionEpargnant[DateReport_Date] <= DateAppel + NbJours
)
)
)
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!