Forum Discussion
Help With DAX Meassure
- Anonymous2 years ago
Hi, SantiagoRandado
Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.
Steps:
Measures:
Color = VAR _lastDay = CALCULATE ( LASTDATE ( 'Table'[date] ), 'Table'[date] ) VAR _weekDay = WEEKDAY ( _lastDay ) VAR _firstDayInLastWeek = CALCULATE ( LASTDATE ( 'Table'[date] ) - _weekDay, ALL ( 'Table' ) ) VAR _lastWeek = IF ( SELECTEDVALUE ( 'Table'[date] ) >= _firstDayInLastWeek, 1 ) RETURN IF ( _lastWeek = 1, "light blue", "light Green" )If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
SantiagoRandado Looks like it is missing an aggregation:
measure =
var a = selectedvalue(calender[date])
var b = maxx(filter(calender,calender[date]=a),calender[week])
return
if(MAX(calender[week])=b,"#FFFF00","#008000")Thanks for your help. but all weeks are #008000, also the last week shown un the graph
- Dangar3322 years agoResident Rockstar
Hi, SantiagoRandado
try below measureand for conditional formatting follow this Link for steps of conditional formatting
max week color = var a= CALCULATE(MAX(Sales[week]),ALLSELECTED('Table')) return IF(MAX('Table'[week nu])=a,"yellow","green")download file from below link