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
pschommer
Helper II
Helper II

ALL returning different results in Excel and PBI

Hi all,

I have a single table where I am trying to display a table of filtered data for one field and display mostly filtered data for another field. I intend to use the ALL function for the second field. I am seeing different results in Excel vs. PBI.

 

First field: Distinct Count of Visit

Second field (I want to remove the Lab Name filter from the count but include all other filters):

NewMeasure = CALCULATE(DISTINCTCOUNT(Table1[Visit]),ALL(Table1[Lab Name])) 

 

I expect field 1 to show different values depending on the Lab Name selected, but field 2 should remain the same regardless of which Lab Name is selected. I get exactly what I expect in Excel, but PBI gives me (mostly) the same result for both fields: the field 1 value.

example1Excel.jpgexample1PBI.jpg

If I select different lab names in Excel, the second column stays the same. This is expected. Doing the same thing in PBI makes the second column change.

 

I saw the post regarding the use of SORT and ALL returning different results in Excel vs. PBI, but there is no SORT in either of the examples.

 

Excel model can be found HERE.

PBIX file can be found HERE.

 

Any help on this vexing problem would be appreciated.

1 ACCEPTED SOLUTION

hi @pschommer

 

You need to create the Year-Month Column in the Table.

 

Lab Date =
Table1[Lab Date and Time].[Year] & "-"
    & Table1[Lab Date and Time].[Month]

Use this in a Slicer and will Work.

 




Lima - Peru

View solution in original post

3 REPLIES 3
Vvelarde
Community Champion
Community Champion

@pschommer

 

Hi, you need to upload to drive, dropbox or similars and post the link.

 




Lima - Peru

hi @pschommer

 

You need to create the Year-Month Column in the Table.

 

Lab Date =
Table1[Lab Date and Time].[Year] & "-"
    & Table1[Lab Date and Time].[Month]

Use this in a Slicer and will Work.

 




Lima - Peru

As you predicted, @Vvelarde, it worked! I would have NEVER thought of doing that. (Well, maybe not NEVER, but certainly not in the near future.)

 

PBI has the ability to create date hierarchies, and they're pretty slick. I like them and use them when appropriate. PowerPivot (in Excel 2013) does not have that ability, so I created my own date grouping of months. That was a difference between the two models that I didn't think much of. A date is a date is a date, right? Clearly, not so much.

 

To me, it seems odd that the way dates are grouped can cause PBI to return different results. There must be more to it that I don't understand.

 

(I believe I read something where Excel 2016 has date hierarchies in their models, but I'm using 2013).

 

Thank you so much for your response!

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.