Forum Discussion
akshayraom
5 years agoFrequent Visitor
Need help to Create a Measure
Hi All Im new to dax , i need to create a measure which will calculate count of delivery days based on slicer selection. I have Market and country in slicer. But i need to count different days for di...
- 5 years ago
Hi akshayraom ,
I create a simple sample based on your description. Please check if the attched file is what you want.
Measure = IF ( ISFILTERED ( 'dim table'[Country] ), SWITCH ( SELECTEDVALUE ( 'dim table'[Country] ), "Japan", COUNTROWS ( FILTER ( 'fact table', [Delivery] < 3 ) ), "Singapore", COUNTROWS ( FILTER ( 'fact table', [Delivery] < 4 ) ), COUNTROWS ( FILTER ( 'fact table', [Delivery] < 6 ) ) ), IF ( ISFILTERED ( 'dim table'[Geo Market] ), SWITCH ( SELECTEDVALUE ( 'dim table'[Geo Market] ), "Greater Asia", COUNTROWS ( FILTER ( 'fact table', [Delivery] < 2 ) ) ) ) )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Icey
5 years agoCommunity Support
Hi akshayraom ,
I create a simple sample based on your description. Please check if the attched file is what you want.
Measure =
IF (
ISFILTERED ( 'dim table'[Country] ),
SWITCH (
SELECTEDVALUE ( 'dim table'[Country] ),
"Japan", COUNTROWS ( FILTER ( 'fact table', [Delivery] < 3 ) ),
"Singapore", COUNTROWS ( FILTER ( 'fact table', [Delivery] < 4 ) ),
COUNTROWS ( FILTER ( 'fact table', [Delivery] < 6 ) )
),
IF (
ISFILTERED ( 'dim table'[Geo Market] ),
SWITCH (
SELECTEDVALUE ( 'dim table'[Geo Market] ),
"Greater Asia", COUNTROWS ( FILTER ( 'fact table', [Delivery] < 2 ) )
)
)
)
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.