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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
szabofe
Frequent Visitor

How to test for blank values in matrix visual and replace them with a previous value from the table?

Hi Community, 

I'd like to make a report based on occationally entered soc. media data.
The user enters data related to a specific date and team by soc. media.
How many followers the team has on the specific date?
There are missing weeks, months like this:
(The MAX of the timeperiod can be seen.
I'd like to put a visual on the report witch shows the trend in the end.)

szabofe_0-1669669957444.png

There are two tables in the sample:

szabofe_1-1669670067107.png

I wrote a measure to fill in the matrix cells. 
The returning value would have to corrigate the missing values.
In place of 101010 will come a measure.
(... why don't we have DAX formatting here... )

 

 

_MaxFollowerCount = 

    VAR dateMinDateInPeriod = 
        MINX(
            VALUES('Table'[id]);
            VAR dateMin = 
                CALCULATE(
                    MIN('DateTable'[Date]);
                    RELATEDTABLE(DateTable)
                )
            RETURN dateMin
        )

    VAR intMAXinPeriod = 
        MAXX(
            'Table';
            VAR intMax = MAX('Table'[Value])
            RETURN
                IF( 
                    ISBLANK(intMax) || intMax = 0;
                    101010;
                    intMax
                )
        )

    RETURN
        intMAXinPeriod

 

 

 
My problem is that: 
The value in the blank cells is not BLANK() nor 0 ... 
I never get back 101010...
What is my failure or missunderstanding?

Thank you for any help.

Regards, 
F.

 
3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @szabofe ,

 

Please share some sample data so that we could test the formula.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hi Jay, 

What is your opinion? 
Am I on the right track?

Thanks and regards, 
F.

Hi Jay,

You can download my sample from the link below.
TestSocMed.pbix
Thank you for your help.
I got a bit forward in the solution. 
Probably the direction of the iteration in the MAXX sould be on the DateTable side...

    VAR tableDateTableFiltered = 
        FILTER(
            VALUES(DateTable[Date]),
            DateTable[Date] >= dateMinDateInTable && 
                DateTable[Date] <= dateMaxDateInTable
        )

    VAR intMAXinPeriod = 
        MAXX(
            tableDateTableFiltered,
            VAR intMax =
                    MAX('Table'[Value])
            RETURN
                COALESCE( 
                    intMax,
                    101010
                )
        )

 Now the matrix looks like this:

szabofe_0-1669718380363.png

Now I'm fighting with the right measure that gives me back the previous value in the series 
- the value from the before column, that precedes 101010.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors