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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
kattlees
Post Patron
Post Patron

How to remove records during count

I need to count the number of people charged for a room each night.  The problem lies in when a charge is put in and then reversed because it was done in error. (People expected to stay but then don't or just input error)

 

See screenshot - This person would only have 1 on 11-22 and 1 on 11-23. I don't want the 11-24 and 11-25 to be counted.  I tried a Count if ChgAmt > 0 but it doesn't zero out total. It does it per line.  I tried removing duplicates but i would need both lines removed.

 

Any thoughts?

 

RoomCount.jpg

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @kattlees,

 

Please create a measure:

Sum amount =
CALCULATE (
    SUM ( RCC[ChgAmount] ),
    ALLEXCEPT ( RCC, RCC[RCC], RCC[ChgServDate] )
)

Add above measure into visual level filter and set it to be greater than 0.

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @kattlees,

 

Please create a measure:

Sum amount =
CALCULATE (
    SUM ( RCC[ChgAmount] ),
    ALLEXCEPT ( RCC, RCC[RCC], RCC[ChgServDate] )
)

Add above measure into visual level filter and set it to be greater than 0.

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mattbrice
Solution Sage
Solution Sage

Assuming a new visual with Date value on rows, 

 

TotalDailyCharge = SUM ( Table[DailyCharge] )

 Then

 

Count people = COUNTROWS (FILTER ( VALUES ( Table[AcctNum] ), [TotalDailyCharge] <> 0 ) )

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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