Forum Discussion
Filter a card by two dates
Hi everyone,
I need to filter a card by a date. The card has a mesure that calculates how many products are sold every day divided by the open shops of that day.
What i want:
So 'New Products[Launch date]' has to filter 'Open shops'[Date]' in the card.
Thank you!
2 Replies
- AnonymousNot applicable
Hey in this case, you need to hardcode measures for your card. Otherwise, the filter will apply to page visuals.
- v-jianboli-msftCommunity Support
Hi Marcos_Noguer ,
If your tables are like this:
You can create three different cards to achieve your purpose, here is the DAX:
UDLs(first day) = CALCULATE ( DIVIDE ( SUM ( 'PRODUCT_MIX_RVC'[CANT_TRX] ), SUM ( 'Open shops'[Count] ) ), FILTER ( 'Open shops', [Date] = MAX ( 'New Products'[Launch date] ) ) ) UDLs(first week) = CALCULATE ( DIVIDE ( SUM ( 'PRODUCT_MIX_RVC'[CANT_TRX] ), SUM ( 'Open shops'[Count] ) ), FILTER ( 'Open shops', [Date] = MAX ( 'New Products'[Launch date] ) + 7 ) ) UDLs(first month) = CALCULATE ( DIVIDE ( SUM ( 'PRODUCT_MIX_RVC'[CANT_TRX] ), SUM ( 'Open shops'[Count] ) ), FILTER ( 'Open shops', MONTH ( [Date] ) = MONTH ( MAX ( 'New Products'[Launch date] ) ) + 1 && DAY ( [Date] ) = DAY ( MAX ( 'New Products'[Launch date] ) ) ) )Final output:
If it isn't your expected output, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.