Forum Discussion
Single Date filter for Multiple Columns and add Measures
- 6 years ago
Hi Kostas ,
Here is the .pbix that you can try it again: PBIX
Put the Date filter measure in the table visual filter and set up value as 1, put the Total measure in a card visual direcrtly and it should work fine.
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi Kostas ,
I have modified the count measure like this:
Total =
VAR _mindate =
CALCULATE ( MIN ( 'Date'[Date] ), ALLSELECTED ( 'Date' ) )
VAR _maxdate =
CALCULATE ( MAX ( 'Date'[Date] ), ALLSELECTED ( 'Date' ) )
VAR tab =
SUMMARIZE (
'Table',
[ID],
[Date1],
[Date2],
"Flag",
VAR _date1 = 'Table'[Date1]
VAR _date2 = 'Table'[Date2]
RETURN
IF ( _date1 < _mindate && _date2 < _maxdate, 1, 0 )
)
RETURN
SUMX ( tab, [Flag] )When you use Date filter measure to set up value as 1 in the table visual, it will show the correct result in the card visual:
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hello v-yingjl ,
Thanks for the help and your code.
Indeed with the new code I was able to get the correct results in the table as it allowed me to place the filter of date in the filter section.
Unfortunately I cannot still make the card show the correct results.
Are you able to share the pbix file with me please?
Thanks in advance
Kostas
- v-yingjl6 years ago
Community Support
Hi Kostas ,
Here is the .pbix that you can try it again: PBIX
Put the Date filter measure in the table visual filter and set up value as 1, put the Total measure in a card visual direcrtly and it should work fine.
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.