Forum Discussion
Marcos_Noguer
4 years agoNew Member
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. UDLs = SUM('PRODUCT_MIX_RVC'[C...
v-jianboli-msft
Community Support
4 years agoHi 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.