Forum Discussion
Help with DAX measure for chart
1. If you don't want to show any values when there's no selection in slicer, you should use ISFILTERED() in your condition.
Serie Value = IF(HASONEVALUE('Table1'[SerieName]) && ISFILTERED('Table1'[SerieName]) ;CALCULATE(Sum('Table2'[Value]));BLANK())
See my test below:
2. If you have built the relationship between two tables (one to many on Series ID), you can directly use the From_Date column in your IF statement.
Serie Value = IF(HASONEVALUE('Table1'[From_Date]) && ISFILTERED('Table1'[From_Date]) ;CALCULATE(Sum('Table2'[Value]));BLANK())
Regards,
Thanks v-sihou-msft for your suggestions.
No problem with point 1, I've understood :smileywink:
About point 2, yes I've got a One to many relationship between the two tables (one to many on Series ID), perhaps I didn't explain it well:
After selecting a serie from the Series Names filter, I'd like to display into my chart only value of datetime > selectedDate (where for selectedDate I mean the corresponding From_Date date of the selected Serie Name in the filter. I've almost reached the aim with this DAX measure, but I have used the "NOW()" date instead of the selectedDate
Serie Value = IF(HASONEVALUE('Table1'[SerieName]) && ISFILTERED('Table1'[SerieName]);CALCULATE(SUMX(FILTER(Table2; [DateTime]>NOW()); 'Table2'[Value]));BLANK())How should I modify the above expression? If I try to substitute "NOW()" by Table1[From_Date] I've got an error :manfrustrated:
Thanks a lot in advance!
- laciodrom_809 years agoHelper IV
Any suggestion?