Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
67 | |
64 | |
57 | |
39 | |
27 |
User | Count |
---|---|
85 | |
59 | |
45 | |
43 | |
38 |