Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Month | Product | SalesAmount |
Jan | A | 0 |
Jan | B | 84 |
Jan | C | 0 |
Feb | A | 68 |
Feb | B | 0 |
Feb | C | 0 |
Mar | A | 92 |
Mar | B | 0 |
Mar | C | 0 |
Apr | A | 61 |
Apr | B | 76 |
Apr | C | 0 |
How could it be done?
Solved! Go to Solution.
Hi @FreemanZ ,
Min sales:
easure =
var minsales = CALCULATE(MIN('Table'[SalesAmount]),FILTER(ALLEXCEPT('Table','Table'[Product]),'Table'[MonthNo]>MAXX(ALLSELECTED('Table'),'Table'[MonthNo])-3))
return
IF(minsales>0,0,1)
Sum sales:
Measure =
var sumsales = CALCULATE(SUM('Table'[SalesAmount]),FILTER(ALLEXCEPT('Table','Table'[Product]),'Table'[MonthNo]>MAXX(ALLSELECTED('Table'),'Table'[MonthNo])-3))
return
IF(minsales>0,0,1)
Best Regards,
Jay
Hi @FreemanZ ,
Min sales:
easure =
var minsales = CALCULATE(MIN('Table'[SalesAmount]),FILTER(ALLEXCEPT('Table','Table'[Product]),'Table'[MonthNo]>MAXX(ALLSELECTED('Table'),'Table'[MonthNo])-3))
return
IF(minsales>0,0,1)
Sum sales:
Measure =
var sumsales = CALCULATE(SUM('Table'[SalesAmount]),FILTER(ALLEXCEPT('Table','Table'[Product]),'Table'[MonthNo]>MAXX(ALLSELECTED('Table'),'Table'[MonthNo])-3))
return
IF(minsales>0,0,1)
Best Regards,
Jay
This code works:
Hi,
Please check the below picture and the attached pbix file.
All measures are in the attached pbix file.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 19 | |
| 11 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 20 | |
| 12 | |
| 10 |