Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ASheller1023
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:

ASheller1023_0-1706128678190.png

If needed, here is the DAX expression:

ASheller1023_1-1706128741204.pngASheller1023_2-1706128765400.png

 

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

 

2 ACCEPTED SOLUTIONS
v-heq-msft
Community Support
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

 

View solution in original post

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()
            )
        )

View solution in original post

4 REPLIES 4
ASheller1023
Regular Visitor

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

v-heq-msft
Community Support
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

 

ASheller1023
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()
            )
        )

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.