The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello everyone i have 2 calculations, and a date timeline slicer
First calculation is var newrevenue = sum(revenuetable[total_amount])
Second calculation is var oldrevenue = Sumx(revenuetable, revenuetable[quantity] * revenuetable[amount])
I have one measure
Financial value =
var newrevenue = sum(revenuetable[total_amount])
var oldrevenue = Sumx(revenuetable, revenuetable[quantity] * revenuetable[amount])
Var expenses = sum(expenses[total]
Now here is my challenge if i selected on timeslicer month of october and onwards, i want to get result from newrevenue calculation else everything before october i want oldrevenue cculation
So something like
Var grossprofit = if( date < DATE(2022,10,1),oldrevenue,newrevenue) - expenses
Solved! Go to Solution.
@Anonymous , Assume all these are part on a measure, based on what I got
Var grossprofit = if( date < maxx(allselected('Date'), 'Date'[Date]),oldrevenue,newrevenue) - expenses
You might need use Sumx with some group by column for the correct grand total
Var grossprofit = Sumx(Values(Account[Account]) ,calculate( if( date < maxx(allselected('Date'), 'Date'[Date]),oldrevenue,newrevenue) - expenses ) )
Hi @Anonymous ,
I have created a simple sample, please refer to it to see if it helps you.
Create a measure.
Measure = var _selected=SELECTEDVALUE('date'[Date])
return
IF(_selected<=TODAY(),[measure1],[Measure2])
If I have misunderstood your meaning, please provide more details with your desired output and pbix file without privacy inforamtion.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I have created a simple sample, please refer to it to see if it helps you.
Create a measure.
Measure = var _selected=SELECTEDVALUE('date'[Date])
return
IF(_selected<=TODAY(),[measure1],[Measure2])
If I have misunderstood your meaning, please provide more details with your desired output and pbix file without privacy inforamtion.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Assume all these are part on a measure, based on what I got
Var grossprofit = if( date < maxx(allselected('Date'), 'Date'[Date]),oldrevenue,newrevenue) - expenses
You might need use Sumx with some group by column for the correct grand total
Var grossprofit = Sumx(Values(Account[Account]) ,calculate( if( date < maxx(allselected('Date'), 'Date'[Date]),oldrevenue,newrevenue) - expenses ) )
Thank you very much