Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello
What measure can be used to identify customers with
- No sales in Selected Month
- No sales in Previous Month
- No sales in Previous 3 Month ?
Hi @slyfox,
Please try below measures:
No sales in selected Month =
IF (
CALCULATE (
SUM ( F_Invoice[Qty] ),
FILTER (
ALL ( F_Invoice ),
F_Invoice[LINK_Customer] = SELECTEDVALUE ( D_Customer[LINK_Customer] )
&& YEAR ( F_Invoice[LINK_Date] ) = SELECTEDVALUE ( D_Date[DATE_YearNumber] )
&& MONTH ( F_Invoice[LINK_Date] ) = SELECTEDVALUE ( D_Date[DATE_MonthNumber] )
)
)
= BLANK (),
"No sales",
"Have Sales"
)
No sales in previous Month =
VAR previousYearNumber =
IF (
SELECTEDVALUE ( D_Date[DATE_MonthNumber] ) = 1,
SELECTEDVALUE ( D_Date[DATE_YearNumber] ) - 1,
SELECTEDVALUE ( D_Date[DATE_YearNumber] )
)
VAR previousMonthNumber =
IF (
SELECTEDVALUE ( D_Date[DATE_MonthNumber] ) = 1,
12,
SELECTEDVALUE ( D_Date[DATE_MonthNumber] ) - 1
)
RETURN
IF (
CALCULATE (
SUM ( F_Invoice[Qty] ),
FILTER (
ALL ( F_Invoice ),
F_Invoice[LINK_Customer] = SELECTEDVALUE ( D_Customer[LINK_Customer] )
&& YEAR ( F_Invoice[LINK_Date] ) = previousYearNumber
&& MONTH ( F_Invoice[LINK_Date] ) = previousMonthNumber
)
)
= BLANK (),
"No sales",
"Have Sales"
)
No sales in previous 3 Month =
IF (
CALCULATE (
SUM ( F_Invoice[Qty] ),
DATESINPERIOD (
D_Date[DATE_Date].[Date],
DATE ( SELECTEDVALUE ( D_Date[DATE_YearNumber] ), SELECTEDVALUE ( D_Date[DATE_MonthNumber] ), 1 ),
-3,
MONTH
),
FILTER (
ALL ( F_Invoice ),
F_Invoice[LINK_Customer] = SELECTEDVALUE ( D_Customer[LINK_Customer] )
)
)
= BLANK (),
"No sales",
"Have Sales"
)
Best regards,
Yuliana Gu
Dear @v-yulgu-msft
The problem is that the grand total on the column does not display the sum of such customers for which there were no sales.
Could be possible to adjust your measures ?
up
Up
up
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 44 | |
| 42 | |
| 19 | |
| 19 |
| User | Count |
|---|---|
| 72 | |
| 67 | |
| 33 | |
| 32 | |
| 31 |