Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have two data sources, my problem is the If statement is not working in my measure.
What I need: I want to use Data A if the Year is Current Year, if not I will use Data B.
Please help.
Solved! Go to Solution.
@fssebastian , Assuming they are tables. You need a common date/year table then you can create a measure like
if(year(max('Date'[Date]) = Year(Today) , sum(TableA[Value]) , sum(TableB[Value]) )
you need use year/date in visual from date/year table
if needed
sumx(Values('Date'[year]) , if(year(max('Date'[Date]) = Year(Today) , sum(TableA[Value]) , sum(TableB[Value]) ) )
@fssebastian , Assuming they are tables. You need a common date/year table then you can create a measure like
if(year(max('Date'[Date]) = Year(Today) , sum(TableA[Value]) , sum(TableB[Value]) )
you need use year/date in visual from date/year table
if needed
sumx(Values('Date'[year]) , if(year(max('Date'[Date]) = Year(Today) , sum(TableA[Value]) , sum(TableB[Value]) ) )
Thank you, my mind just went blank for a minute. This helps. Thank you!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
82 | |
66 | |
61 | |
46 | |
45 |