Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kajelliott
Helper I
Helper I

If created date matches calendar date & value is greater than 0, then "true"

Hi All, 

 

I am trying to identify names where a created date year and month matches the calendar date year and month AND the 'Previous Month Charagable Var' is greater than 0 so that I can add a true/false legend to my stacked column chart visual. 

 

The created date and calendar date have an inactive relationship, the "Previous Month Chargable Var' is a measure.

Any help is appreciated!

 

kajelliott_0-1680652496113.png

 

2 REPLIES 2
amitchandak
Super User
Super User

@kajelliott , Not very clear. I usually join the date(without timestamp) with date table and create this month vs last month

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

Apologies I wasnt very clear! Ive re worked my example a bit to hopefully give you a better idea of what I mean. 

I'm trying to create a measure so that if the Calendar YearMonth matches the Created YearMonth AND the 'Previous Month Chargable Var' equals greater than zero, then flag. (to confirm, the 'Previous Month Chargable Var is already a variation of volume between months).
I have highlighed the below table to show what I mean.
Then once I have flagged everything, I can then add it to my column chart so that it is stacked, flagged and unflagged. 

 

 

kajelliott_0-1680662391376.png

Hopefully that makes better sense!

Thank you 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.