Forum Discussion
ldwf
4 years agoHelper V
DAX code for measure not working
Hello, I have a PBI star schema model. i'm trying to define a measure in the fact table using a numeric field (health index) that resides in one of the dimension tables and corresponds to the maxi...
- 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
ldwf
4 years agoHelper V
Hi, thanks for the suggestion. Unfortunately, it doesn't make a difference. I think my DAX formula is almost there, just needs some tweaking. I just want the value from the dimension table that corresponds to the maximum date that is selected in the slicer. I know the joins between the tables are correct so I don't know what hte problem is
Ashish_Mathur
4 years agoSuper User
Hi,
Share the link from where i can download your PBI file.
- ldwf4 years agoHelper V
Unfortunately, for security reasons, I can't provide the .pbix file