The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I am using this measure:
CALCULATE(Parameter[Parameter Value]*DISTINCTCOUNT(Query1[order_number_id]), FILTER(Query1, Query1[product_type] = "Subscriptions"), FILTER(ALL('Date Table'[Weekday]), 'Date Table'[Weekday] IN {"Monday","Tuesday","Wednesday","Thursday","Friday"}), FILTER(ALL('Time Table'[Time]), 'Time Table'[Time] >= TIME(9,0,0) && 'Time Table'[Time] <= TIME(15,0,0)))
And the second and third filters are not doing what is expected. Basically the calculation is being applied to this entire matrix, rather than just Monday-Friday from 9am to 5pm. The first filter is working fine.
Date Table[Weekday] makes up the columns, and Time Table[Time] makes up the rows, so I am not sure what is going wrong here. I have also tried this measure with the same results:
CALCULATE(Parameter[Parameter Value]*DISTINCTCOUNT(Query1[order_number_id]), FILTER(Query1, Query1[product_type] = "Subscriptions"), FILTER('Date Table', 'Date Table'[Weekday] IN {"Monday","Tuesday","Wednesday","Thursday","Friday"}), FILTER('Time Table', 'Time Table'[Time] >= TIME(9,0,0) && 'Time Table'[Time] <= TIME(15,0,0)))
I am at a loss as to why only the second and third measures are not applying! Any help is appreciated!
Solved! Go to Solution.
I actually solved this myself after posting using this measure instead:
IF(MAX('Date Table'[Weekday]) IN {"Monday","Tuesday","Wednesday","Thursday","Friday"} && MAX('Time Table'[Time]) >= TIME(9,0,0) && MAX('Time Table'[Time]) <= TIME(15,0,0), CALCULATE(Parameter[Parameter Value]*DISTINCTCOUNT(Query1[order_number_id]), FILTER(Query1, Query1[product_type] = "Subscriptions")) , 0)
I actually solved this myself after posting using this measure instead:
IF(MAX('Date Table'[Weekday]) IN {"Monday","Tuesday","Wednesday","Thursday","Friday"} && MAX('Time Table'[Time]) >= TIME(9,0,0) && MAX('Time Table'[Time]) <= TIME(15,0,0), CALCULATE(Parameter[Parameter Value]*DISTINCTCOUNT(Query1[order_number_id]), FILTER(Query1, Query1[product_type] = "Subscriptions")) , 0)