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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
gujralh
Helper I
Helper I

Count condition in place of Total column

Hello All,

 

How I can replace Total column with countif condition (say >36000 for last 8 days) in below matrix visual.

I  tried  by creating other measure for same count if condition and added in visual but it is giving value against every date and that I don't want.  I need just same matrix (1st) with Count if condition instead of total column.

 

gujralh_1-1717320578560.png

 

gujralh_2-1717320896304.png

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

I changed a condition to implement last three days sales amount, but I hope you can change the condition based on your business logic.

 

Jihwan_Kim_1-1717333867536.png

 

 

Jihwan_Kim_0-1717333845290.png

 

 

expected result sales: = 
VAR _lastdate =
    MAXX ( SUMMARIZE ( sales, 'calendar'[Date] ), 'calendar'[Date] )
VAR _lastthreedays =
    FILTER (
        ALL ( 'calendar' ),
        'calendar'[Date] <= _lastdate
            && 'calendar'[Date] >= _lastdate - 2
    )
RETURN
    SWITCH (
        TRUE (),
        ISINSCOPE ( 'calendar'[Date] ), SUM ( sales[sales] ),
        CALCULATE ( SUM ( sales[sales] ), _lastthreedays )
    )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

6 REPLIES 6
gujralh
Helper I
Helper I

@Jihwan_Kim 
How we can filter out with item say >5 value on any specific date (say 5/31) which show those rows only with your shared calculation.

Actually when I'm filtering any greater than value than its only putting the blank value in columns. But I need it to show those items rows only when condition meets for selected date, rest all should be hidden.

Hi,

Sorry that it is a little bit difficult for me to understand your question.

Please provide your sample pbix file's link together with how your expected outcome looks like.

It will help for me to understand more clearly.

Thank you.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Hi @Jihwan_Kim 

 

I need the data in this way, like when i filter value on date (say 6/4/2024) with greater than value 36000 then its showing those rows only , this i did in excel.

gujralh_1-1717766246972.png

 

But in power BI, It only replace with blank rows only.[Say matrix 2 from PB]

gujralh_2-1717766773329.png

 

Anonymous
Not applicable

Hi @gujralh ,

I think one of the misconceptions you have is that in Power BI Desktop, whether you select Table view or Matrix view, as long as there is a value for the current row, then it is also not possible to hide certain rows like Excel will.

In other words, if you want to hide the row, it will only be visible in Visual if it does not have any value. The following screenshot is an example you can refer to.

vyilongmsft_2-1718762863654.png

vyilongmsft_0-1718762677202.png

vyilongmsft_1-1718762840129.png

 

 

 

Best Regards

Yilong Zhou

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

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

I changed a condition to implement last three days sales amount, but I hope you can change the condition based on your business logic.

 

Jihwan_Kim_1-1717333867536.png

 

 

Jihwan_Kim_0-1717333845290.png

 

 

expected result sales: = 
VAR _lastdate =
    MAXX ( SUMMARIZE ( sales, 'calendar'[Date] ), 'calendar'[Date] )
VAR _lastthreedays =
    FILTER (
        ALL ( 'calendar' ),
        'calendar'[Date] <= _lastdate
            && 'calendar'[Date] >= _lastdate - 2
    )
RETURN
    SWITCH (
        TRUE (),
        ISINSCOPE ( 'calendar'[Date] ), SUM ( sales[sales] ),
        CALCULATE ( SUM ( sales[sales] ), _lastthreedays )
    )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Thanks @Jihwan_Kim 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.