Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi ,
I need help with one of the the requirement. I have a csutomer churn table with csutomer and churn status and an invoice table.
For new and returning customer there is not any issue since they fall in the same fiscal year and can be easily sliced.
The issue is with the lost customer. If a customer is lost in 2022 then it will have revenue in 2021 and not in 2022. But the client wants to see the figures as lost revenue in 2022 and not 2021. Could you please help how i can do this in power bi.
I have attached the sample pbix file with data. Please let me know for any questions.
https://drive.google.com/file/d/1ZdbyUWeARhVWBV8ncd47izKbhnR5MKY-/view?usp=drive_link
I have to show lost /new/returning in the bar chart as legend and the revenue for the different fiscal year. If a customer is lost in 2022 , in 2022 it should should show lost revenue(2021 revenue)
Solved! Go to Solution.
Hello @DiKi-I
You can refer to the following solution.
1.Create a new table. the table has no relationship with other tables.
ChurnType = VALUES(CustomerChurn[Churn])
2.Create a measure
MEASURE =
SWITCH (
SELECTEDVALUE ( 'ChurnType'[Churn] ),
"Lost",
VAR a =
CALCULATETABLE (
VALUES ( CustomerChurn[ContactID] ),
ALLSELECTED ( CustomerChurn[ContactID] ),
CustomerChurn[FiscalYear] = SELECTEDVALUE ( 'Date'[FiscalYear] ),
CustomerChurn[Churn] = "Lost"
)
RETURN
CALCULATE (
SUM ( Invoice[Amount] ),
ALL ( Invoice ),
Invoice[ContactID] IN a,
Invoice[FiscalYear]
= SELECTEDVALUE ( 'Date'[FiscalYear] ) - 1
),
CALCULATE (
SUM ( Invoice[Amount] ),
CustomerChurn[Churn] IN VALUES ( 'ChurnType'[Churn] )
)
)
3.Then create a bar chart, and put the following field to the visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much it worked.
Hello @DiKi-I
You can refer to the following solution.
1.Create a new table. the table has no relationship with other tables.
ChurnType = VALUES(CustomerChurn[Churn])
2.Create a measure
MEASURE =
SWITCH (
SELECTEDVALUE ( 'ChurnType'[Churn] ),
"Lost",
VAR a =
CALCULATETABLE (
VALUES ( CustomerChurn[ContactID] ),
ALLSELECTED ( CustomerChurn[ContactID] ),
CustomerChurn[FiscalYear] = SELECTEDVALUE ( 'Date'[FiscalYear] ),
CustomerChurn[Churn] = "Lost"
)
RETURN
CALCULATE (
SUM ( Invoice[Amount] ),
ALL ( Invoice ),
Invoice[ContactID] IN a,
Invoice[FiscalYear]
= SELECTEDVALUE ( 'Date'[FiscalYear] ) - 1
),
CALCULATE (
SUM ( Invoice[Amount] ),
CustomerChurn[Churn] IN VALUES ( 'ChurnType'[Churn] )
)
)
3.Then create a bar chart, and put the following field to the visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Ibendlin
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
75 | |
63 | |
51 | |
48 |
User | Count |
---|---|
204 | |
86 | |
64 | |
59 | |
56 |