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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Dax function

DanduMani104_0-1703667288306.png

Hi team, I have This Type of Data in a matricx table,My current week is falls under Q4.

My Question is that the Blank cells in the remaining Quarters should show as '0' in blank cells.

 

Can you peaople help me with the DAX function.

 

I have used this Fuction, It will not showing remaing blank cells as 0.

 

IF(ISBLANK(DISTINCTCOUNT('Append_QMR'[TOUR_REQUEST_NO])) ,0, CALCULATE(DISTINCTCOUNT('Append_QMR'[TOUR_REQUEST_NO]) ,
FILTER(ALL('Append_QMR'),
'Append_QMR'[WEEK_NO]=WEEKNUM(TODAY()) &&
'Append_QMR'[TERMINATION_YEAR]=2023 &&
'Append_QMR'[Year]=2023 &&
-----'Append_QMR'[TOUR_STATUS_KEY]=7 &&
'Append_QMR'[QT_EXCLUDE_FLG]=0 &&
'Append_QMR'[SALES_OFFICE_KEY] in VALUES(M_OFFICE_D[OFFICE_KEY]) &&
'Append_QMR'[TOUR_TYPE_KEY] IN VALUES('M_TOUR_TYPE_D'[TOUR_TYPE_KEY]) &&
'Append_QMR'[DEPARTURE_DATE_KEY] In VALUES('Depor M_DATE_D'[DATE_KEY]) &&
'Append_QMR'[TERMINATION_DATE_KEY] In VALUES('M_DATE_D'[DATE_KEY]) &&
'Append_QMR'[DEPARTURE_MONTH_KEY]>=MONTH(TODAY())
)))



2 ACCEPTED SOLUTIONS
Fowmy
Super User
Super User

@Anonymous 

You can add +0 at the end of your measure :

IF (
    ISBLANK ( DISTINCTCOUNT ( 'Append_QMR'[TOUR_REQUEST_NO] ) ),
    0,
    CALCULATE (
        DISTINCTCOUNT ( 'Append_QMR'[TOUR_REQUEST_NO] ),
        FILTER (
            ALL ( 'Append_QMR' ),
            'Append_QMR'[WEEK_NO] = WEEKNUM ( TODAY () )
                && 'Append_QMR'[TERMINATION_YEAR] = 2023
                && 'Append_QMR'[Year] = 2023
                && -----'Append_QMR'[TOUR_STATUS_KEY]=7 &&
            'Append_QMR'[QT_EXCLUDE_FLG] = 0
                && 'Append_QMR'[SALES_OFFICE_KEY]
                    IN VALUES ( M_OFFICE_D[OFFICE_KEY] )
                        && 'Append_QMR'[TOUR_TYPE_KEY]
                            IN VALUES ( 'M_TOUR_TYPE_D'[TOUR_TYPE_KEY] )
                                && 'Append_QMR'[DEPARTURE_DATE_KEY]
                                    IN VALUES ( 'Depor M_DATE_D'[DATE_KEY] )
                                        && 'Append_QMR'[TERMINATION_DATE_KEY]
                                            IN VALUES ( 'M_DATE_D'[DATE_KEY] )
                                                && 'Append_QMR'[DEPARTURE_MONTH_KEY] >= MONTH ( TODAY () )
        )
    )
) + 0



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

Anonymous
Not applicable

Iam Done with that

but I Want Another solution ..please hep me

 

View solution in original post

6 REPLIES 6
Fowmy
Super User
Super User

@Anonymous 

You can add +0 at the end of your measure :

IF (
    ISBLANK ( DISTINCTCOUNT ( 'Append_QMR'[TOUR_REQUEST_NO] ) ),
    0,
    CALCULATE (
        DISTINCTCOUNT ( 'Append_QMR'[TOUR_REQUEST_NO] ),
        FILTER (
            ALL ( 'Append_QMR' ),
            'Append_QMR'[WEEK_NO] = WEEKNUM ( TODAY () )
                && 'Append_QMR'[TERMINATION_YEAR] = 2023
                && 'Append_QMR'[Year] = 2023
                && -----'Append_QMR'[TOUR_STATUS_KEY]=7 &&
            'Append_QMR'[QT_EXCLUDE_FLG] = 0
                && 'Append_QMR'[SALES_OFFICE_KEY]
                    IN VALUES ( M_OFFICE_D[OFFICE_KEY] )
                        && 'Append_QMR'[TOUR_TYPE_KEY]
                            IN VALUES ( 'M_TOUR_TYPE_D'[TOUR_TYPE_KEY] )
                                && 'Append_QMR'[DEPARTURE_DATE_KEY]
                                    IN VALUES ( 'Depor M_DATE_D'[DATE_KEY] )
                                        && 'Append_QMR'[TERMINATION_DATE_KEY]
                                            IN VALUES ( 'M_DATE_D'[DATE_KEY] )
                                                && 'Append_QMR'[DEPARTURE_MONTH_KEY] >= MONTH ( TODAY () )
        )
    )
) + 0



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thank you for the help.But when compare to current week count with last week count,It is showing like this

DanduMani104_0-1703671437825.png

But I want to repesent it like current week and last week and variation in Totals only.How can I do that.

 

 

please help

 

Anonymous
Not applicable

DanduMani104_0-1703672344810.png

Like this

 

@Anonymous 

You can modify the measure to check for current week and last week the apply +0 accordingly



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Iam Done with that

but I Want Another solution ..please hep me

 

@Anonymous 

As this works for you, accept it as a solution and open a new queston .

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.