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
Hello,
I have used an IF funtion to replace the blank gross margin % (for months when there is no sales) for 0, so that my line graph doesnt break.
However I then want the months in which there are no sales to return blank, rather than 0, can I please help with this? It seems that when using the IF function blank replacement, all subsequent months are 0, not blank, even when filtering for last sales.
So ideally, the measure, Stop GM% after last sale would be blank from Aug 22 onwards.
Measures
Thanks!
https://1drv.ms/u/s!As8wMr9_bgGrgWstsIAjHqF-oJOI?e=WG8HNb PBIX file link here
Thanks!
Solved! Go to Solution.
Hi @watje255_ju
I hope this is what your looking for https://www.dropbox.com/t/6CtxqpNbKlUr0hd7
Stop GM % after last sale =
Var LastSalesDate = CALCULATE ( MAX (Margin[Month] ), REMOVEFILTERS ( ) )
VAR Result =
IF ( MAX ( DimDate[DateKey]) <= LastSalesDate, [GM% with 0 replacing blank] )
RETURN
Result
Hi @watje255_ju
I hope this is what your looking for https://www.dropbox.com/t/6CtxqpNbKlUr0hd7
Stop GM % after last sale =
Var LastSalesDate = CALCULATE ( MAX (Margin[Month] ), REMOVEFILTERS ( ) )
VAR Result =
IF ( MAX ( DimDate[DateKey]) <= LastSalesDate, [GM% with 0 replacing blank] )
RETURN
Result
Thank you so much!!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 12 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 28 | |
| 19 | |
| 11 | |
| 10 |