Forum Discussion
DAX code for measure not working
- Anonymous4 years ago
Hi ldwf ,
Here are the steps you can follow:
1. Create measure.
Measure = var _min=MINX(ALLSELECTED('Dim Date Table'),[Date]) var _max=MAXX(ALLSELECTED('Dim Date Table'),[Date]) return CALCULATE( MAX('Dim Health Indexes Table'[Health Index]),FILTER(ALL('Dim Health Indexes Table'), 'Dim Health Indexes Table'[Date]=_max))2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi,
Create a Calendar Table with a relationship (Many to One and Single) from the Date column of your Fact table to the Date column of your Calendar Table. In the Calendar Table, create columns for Year, Month name and Month number. Sort the Month name by the Month number. Create slicer for Year and Month name and select a Month and year. To your table visual, drag Country and Date from the Calendar Table. Write this measure
Measure = calculate(sum(Data[Health index]),datesbetween(Calendar[Date],max(calendar[date]),max(calendar[date])))