cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

## Measure works in Matrix but is showing blank for card visual.

Hello,

I have a time intelligence dax expression that I used from Dax Patterns to show previous average cost of quarter to date.  It shows the correct answer in the matrix visual, but shows blank in the card visual.  There are not any filters affecting the visuals.  I have tried proofing my DAX expression and I find that it operates correctly based off the Matrix visual.  I am not sure what else to try to resolve this issue.  Here is a screenshot of the visuals:

If needed, here is the DAX expression:

Any direction is appreciated because I have exhausted any options that I know.

2 ACCEPTED SOLUTIONS
Community Support

Hi @ASheller1023 ,
According to your description, the reason why card is shown as blank may be because measure relies on the context provided by matrix for its calculation, while card visual does not provide a similar context. Card visuals do not maintain row context.

Time intelligence functions often depend on a date context which may be present in a Matrix but not in a Card. Make sure your DAX measure does not require a specific date context to calculate the value.

Best regards

Albert He

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

I believe @v-heq-msft is correct. You can either add a visual filter to the card in order to provide date context or anywhere the measure references MAX('Date'[Column]) you can check if the column is filtered and, if it's not, you can use something like this to return the column value where the date equals today.

VAR LastFiscalYearAvailable =
IF(
HASONEVALUE('CALENDAR'[Fiscal Year]),
MAX('CALENDAR'[Fiscal Year]),
CALCULATE(
MAX('CALENDAR'[Fiscal Year]),
'CALENDAR'[Date] = TODAY()
)
)
4 REPLIES 4
Regular Visitor

Thank you for the answer @birknerj !  I appreciate the help as always!  I hope everything is well!  🙂

Community Support

Hi @ASheller1023 ,
According to your description, the reason why card is shown as blank may be because measure relies on the context provided by matrix for its calculation, while card visual does not provide a similar context. Card visuals do not maintain row context.

Time intelligence functions often depend on a date context which may be present in a Matrix but not in a Card. Make sure your DAX measure does not require a specific date context to calculate the value.

Best regards

Albert He

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Regular Visitor

@birknerjdo you have any ideas, the infamous DAX wizard

I believe @v-heq-msft is correct. You can either add a visual filter to the card in order to provide date context or anywhere the measure references MAX('Date'[Column]) you can check if the column is filtered and, if it's not, you can use something like this to return the column value where the date equals today.

VAR LastFiscalYearAvailable =
IF(
HASONEVALUE('CALENDAR'[Fiscal Year]),
MAX('CALENDAR'[Fiscal Year]),
CALCULATE(
MAX('CALENDAR'[Fiscal Year]),
'CALENDAR'[Date] = TODAY()
)
)

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.