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.
I have a measure where we calculating count of one of the column from one of the fact table:
Lines Cancelled =
VAR selectedDate =
CALCULATE (
MAX ( calendar[calendar_date] ),
ALLSELECTED ( calendar[calendar_date] )
)
VAR result =
CALCULATE (
COUNT ( order_fact[order_id] ),
FILTER (
ALL ( 'calendar' ),
CALCULATE (
MIN ( order_fact[status_change_date] ) >= selectedDate
)
)
)
RETURN
IF ( ISBLANK ( result ), 0, result )
When I pull this measure in table with other dimension column and filtering this measure at visual level such that this measure is not 0, then we are getting correct count. But same when we are adding in card visual we are not getting correct value.
as we are not able to add dimension fields in card visual and also we cannot filter the measure value to non zero.
Is there any way to get correct result by modifying the existing measure
Thanks,
Mohit Gupta
@Anonymous , Try like
VAR result =
CALCULATE (
COUNT ( order_fact[order_id] ),
FILTER (
ALL ( 'calendar' ),
(
( calendar[Date] ) >= selectedDate
)
)
)
or
VAR result =
CALCULATE (
COUNT ( order_fact[order_id] ),
FILTER (
( 'order_fact' ),
MIN ( order_fact[status_change_date] ) >= selectedDate
)
)