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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
bas565
Regular Visitor

Help with summing an aggregation. (Count of worst position). (Equivalent of LOD from Tableau)

I have recently moved from Tableau to Power BI and would like some guidance on how to approach an aggregation issue please. In Tableau i would use LOD for this approach, as i have many times in similar scenarios. 

In this case, i have multiple KPIs within a category. I have a National value, and an Area value (North, West, East, South etc).
I want to know for each KPI, if each KPI is green in every Area (ie Nationally might be on target, but that's hiding the issue that South didn't meet target). 

The approach i've taken for similar aggregations is something like {FIXED CATEGORY:  COUNT(WHERE MAX OUTPUT =1)}. (Red=3, Amber= 2, Green=1). 

EXAMPLE:

bas565_0-1684508545485.png

 
However, if i do this in Power BI, i get Row = 0 (At least one Area not green), + Row =1 (All Areas Green) =0

bas565_4-1684508964962.png

 


This calc sums 0 +1 =0

bas565_2-1684508798563.png

This approach doesn't let me aggregate at all.

bas565_3-1684508845813.png


Ultimately what i'm trying to get to is something like "in Category: Safety. There are 3 KPIs, of which every KPI is green in all Areas so 3/3"

bas565_5-1684509008959.png

bas565_7-1684509193822.pngbas565_8-1684509209524.png

 



I've had a suggestion that because PBI works at row level, i need to have my data with each KPI on a row. Currently i have unpivoted it. I ideally don't want two data sources that are formatted differently for different calcs.

bas565_6-1684509053945.png

 

Thanks for reading. I've had to anonymise the data for this post so don't have a .pbix file to share unfortunately. 



3 REPLIES 3
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

CategoryKPIDateTarget National (Target *CountArea)Target by AreaAmberGoodNationalNorthSouth EastWest
SafetyWork Incidents01/04/2023000Smaller00000
SafetyNear Misses01/04/2023                                      40                         10                    8Bigger5910111523
SafetyFatigue Risk Assessments01/04/2023                                    200                         50                 45Bigger24651625578
FinanceVariance to budget01/04/2023000Smaller-15190-10000-500-1234-3456
FinanceSales01/04/2023                        4,000,000          1,000,000       900,000Bigger   3,919,000800,000950,0001,030,0001,139,000
FinanceProfit01/04/2023                           400,000              100,000         50,000Bigger       540,000135,000145,00080,000180,000
HRLeavers01/04/2023                                      20                           5                    3Smaller33000
HRComplaints01/04/2023                                        8                           2                    1Smaller00000
HRTraining Compliance01/04/202390%90%85%Bigger92%91%93%94%92%

I will work out how to save the file(s) to a cloud and then publish the link. thanks for your guidance. 
Expected outcome at KPI level:

bas565_0-1684743947502.png

Expected Outcome at Category Level:

bas565_1-1684743968926.png

Thanks. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.