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
osinquinvdm
Advocate II
Advocate II

How come it is aggregating?

I have requests that can be either service requests or information requests.

I have the following 3 measures to count them:

 

Nb Requests = CALCULATE(COUNT('311_Details'[DDS]))
Nb Service Requests = CALCULATE([Nb Requests];'311_Details'[Nature]<>"Information")
Nb Info Requests = CALCULATE([Nb Requests];'311_Details'[Nature]="Information")

How come the data now shows as aggregated, instead of getting broken down by Nature.

2017-03-17 16_29_26-311-dashboard - Power BI Desktop.png

The only change I made is to 

What coud explain such a a behaviour?

 

Thanks

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

Nb Info Requests =
CALCULATE (
    [Nb Requests];
    FILTER ( '311_Details'; '311_Details'[Nature] = "Information" )
)

Nb Service Requests =
CALCULATE (
    [Nb Requests];
    FILTER ( '311_Details'; '311_Details'[Nature] <> "Information" )
)

@osinquinvdm

The way you had originally written these they had an implied ALL function

FILTER ( ALL ( '311_Details'[Nature] )... => therefore ignoring any existing filter context!

http://www.sqlbi.com/articles/filter-arguments-in-calculate/

View solution in original post

4 REPLIES 4
Sean
Community Champion
Community Champion

Change the 1st measure to

Nb Requests = COUNT ( '311_Details'[DDS] )

 

sorry about that.

I just applied that simplification but as expected it does not make a difference.

How do I get NB DDI to show 0 on all lines except information?

Sean
Community Champion
Community Champion

Nb Info Requests =
CALCULATE (
    [Nb Requests];
    FILTER ( '311_Details'; '311_Details'[Nature] = "Information" )
)

Nb Service Requests =
CALCULATE (
    [Nb Requests];
    FILTER ( '311_Details'; '311_Details'[Nature] <> "Information" )
)

@osinquinvdm

The way you had originally written these they had an implied ALL function

FILTER ( ALL ( '311_Details'[Nature] )... => therefore ignoring any existing filter context!

http://www.sqlbi.com/articles/filter-arguments-in-calculate/

Thank you so much.

I had no idea that not using an explicit FILTER() function would actually result in using an implicit ALL() function.

The small tweak you recommended made all the difference.

2017-03-20 14_12_03-311-dashboard - Power BI Desktop.png

Thanks again !

 

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.