0
votes

I have a measure which calculates the sum from a fact table which I am not able to slice with Date.

Count Trend = If([Selected Report Type]="Weekly", 
    IF([Selected Api]<>"Multiple",CALCULATE(SUM(FactWeeklyMetrics[Count])),Blank())
, 
    IF([Selected Api]<>"Multiple",CALCULATE(SUM(FactDailyMetrics[Count])),Blank())
)

When I am adding Date to Axis the value disappears from any visual. However If I put a card control it shows total.

[Selected Report Type] and [Selected Api] also a measure to figure out if a value is selected.

1

1 Answers

0
votes

I think your third line/condition do not reach because of Blank() in condition before/second line. Please see below DAX, SWITCH may help:

Count Trend =
SWITCH (
    TRUE (),
    AND ( [Selected Report Type] = "Weekly", [Selected Api] <> "Multiple" ), CALCULATE ( SUM ( FactWeeklyMetrics[Count] ) ),
    //Line below may not required based on your logic
    //AND ( [Selected Report Type] = "Weekly", [Selected Api] = "Multiple" ), CALCULATE ( SUM(FactDailyMetrics[Count])),
    BLANK ()
)