Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
The goal of this statement is to take the first Monday (flagged correctly), take the sum of the measure ONLY for that day and the simply divide by 10 so that by the last Friday the measure is zero. It's resetting on the next Monday back to the original, and I'm lost as to why.
Solved! Go to Solution.
Hi , @singleton2787
I'm sorry,this is my mistable.
You can use this dax to solve your problem:
Measure = var _date =SELECTEDVALUE('Table1'[Date])
var _first_mon =MAXX( FILTER( ALLSELECTED('Table1') , 'Table1'[Date] <= _date && 'Table1'[Flag] <> BLANK()) ,[Date])
var _first_mon_value = CALCULATE( SUM('Table1'[StortyPoints]) , 'Table1'[Date] =_first_mon)
var _minus=IF( DATEDIFF(_first_mon,_date ,DAY)>=7 , DATEDIFF(_first_mon,_date ,DAY)-2,DATEDIFF(_first_mon,_date ,DAY))
var _weekday =WEEKDAY(_date,2)
return
IF(_weekday in {6,7},BLANK(),_first_mon_value - DIVIDE(_first_mon_value,9) * _minus)
The result is as follows:
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @singleton2787
I'm sorry,this is my mistable.
You can use this dax to solve your problem:
Measure = var _date =SELECTEDVALUE('Table1'[Date])
var _first_mon =MAXX( FILTER( ALLSELECTED('Table1') , 'Table1'[Date] <= _date && 'Table1'[Flag] <> BLANK()) ,[Date])
var _first_mon_value = CALCULATE( SUM('Table1'[StortyPoints]) , 'Table1'[Date] =_first_mon)
var _minus=IF( DATEDIFF(_first_mon,_date ,DAY)>=7 , DATEDIFF(_first_mon,_date ,DAY)-2,DATEDIFF(_first_mon,_date ,DAY))
var _weekday =WEEKDAY(_date,2)
return
IF(_weekday in {6,7},BLANK(),_first_mon_value - DIVIDE(_first_mon_value,9) * _minus)
The result is as follows:
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!