Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
70 | |
68 | |
50 | |
32 |
User | Count |
---|---|
117 | |
100 | |
73 | |
65 | |
40 |