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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Sunkari
Responsive Resident
Responsive Resident

Need design help on Power BI modeling

Hi All,

 

I am struggling with following design issue. Please let me know if have any solution for this.

 

I have data in following format. Each column represents one KPI. Source is excel which contains many columns, for simplicity i have copied only KPI's data.

SpendRecievedPILIPO
RRRRR
ANANANANA
GRAGG
GRRGG
GRRRG
GRRAG
RNANANANA
ANANANANA
RGGNANA
NAGGNANA
AGGNANA

 

User is exepecting data in following  grid/chart format in Power BI report. Count of Type with respective to each KPI.

TypeSpendRecivedPILIPO
R35421
G43324
A30110
NA13366

 

I am not getting any solution for above representation. I have created four Measures for Each KPI(Count of Type) total 20 mesures . But using 20 measures, i cann't get the above representation.

 

Could you guide me, how  to model Power BI to achieve this.

Note:I am not able to unpivot  source as excel contains many columns and above graph should be filtered by remaining columns.

 

Let me know if you need any further info.

2 ACCEPTED SOLUTIONS
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Sunkari,

 

Please refer to below steps.

 

In your source table, add several calculated columns:

Count Spend = CALCULATE(COUNT('KPI'[Spend]),ALLEXCEPT('KPI','KPI'[Spend]))

Count Recieved = CALCULATE(COUNT('KPI'[Recieved]),ALLEXCEPT('KPI','KPI'[Recieved]))

Count PI = CALCULATE(COUNT('KPI'[PI]),ALLEXCEPT('KPI','KPI'[PI]))

Count LI = CALCULATE(COUNT('KPI'[LI]),ALLEXCEPT('KPI','KPI'[LI]))

Count PO = CALCULATE(COUNT('KPI'[PO]),ALLEXCEPT('KPI','KPI'[PO]))

1.PNG

 

Then, create an auxiliary table:

KPI2 =
UNION (
    SELECTCOLUMNS ( 'KPI', "Type", 'KPI'[Spend] ),
    SELECTCOLUMNS ( 'KPI', "Type", 'KPI'[Recieved] ),
    SELECTCOLUMNS ( 'KPI', "Type", 'KPI'[PO] ),
    SELECTCOLUMNS ( 'KPI', "Type", 'KPI'[PI] ),
    SELECTCOLUMNS ( 'KPI', "Type", 'KPI'[LI] )
)

 

Create a new table to dispaly the all available Type, and add calculated columns to count the Type with respective to each KPI. 

KPI3 = SUMMARIZE(KPI2,KPI2[Type])

Spend =
IF (
    LOOKUPVALUE ( 'KPI'[Count Spend], 'KPI'[Spend], KPI3[Type] ) = BLANK (),
    0,
    LOOKUPVALUE ( 'KPI'[Count Spend], 'KPI'[Spend], KPI3[Type] )
)

Recieved =
IF (
    LOOKUPVALUE ( 'KPI'[Count Recieved], 'KPI'[Recieved], KPI3[Type] ) = BLANK (),
    0,
    LOOKUPVALUE ( 'KPI'[Count Recieved], 'KPI'[Recieved], KPI3[Type] )
)

PI =
IF (
    LOOKUPVALUE ( 'KPI'[Count PI], 'KPI'[PI], KPI3[Type] ) = BLANK (),
    0,
    LOOKUPVALUE ( 'KPI'[Count PI], 'KPI'[PI], KPI3[Type] )
)

LI =
IF (
    LOOKUPVALUE ( 'KPI'[Count LI], 'KPI'[LI], KPI3[Type] ) = BLANK (),
    0,
    LOOKUPVALUE ( 'KPI'[Count LI], 'KPI'[LI], KPI3[Type] )
)

PO =
IF (
    LOOKUPVALUE ( 'KPI'[Count PO], 'KPI'[PO], KPI3[Type] ) = BLANK (),
    0,
    LOOKUPVALUE ( 'KPI'[Count PO], 'KPI'[PO], KPI3[Type] )
)

2.PNG

 

In report modeling, you can choose table visual to display above data view.

 

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

@v-yulgu-msft Thanks for your help.  I hope your's best solution for this problem. I followed a different approach where i duplicated table for each KPI with two extra columns (KPIName, Value) and done a union all of those tables, used final table for reporting purpose.

View solution in original post

4 REPLIES 4
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Sunkari,

 

Please refer to below steps.

 

In your source table, add several calculated columns:

Count Spend = CALCULATE(COUNT('KPI'[Spend]),ALLEXCEPT('KPI','KPI'[Spend]))

Count Recieved = CALCULATE(COUNT('KPI'[Recieved]),ALLEXCEPT('KPI','KPI'[Recieved]))

Count PI = CALCULATE(COUNT('KPI'[PI]),ALLEXCEPT('KPI','KPI'[PI]))

Count LI = CALCULATE(COUNT('KPI'[LI]),ALLEXCEPT('KPI','KPI'[LI]))

Count PO = CALCULATE(COUNT('KPI'[PO]),ALLEXCEPT('KPI','KPI'[PO]))

1.PNG

 

Then, create an auxiliary table:

KPI2 =
UNION (
    SELECTCOLUMNS ( 'KPI', "Type", 'KPI'[Spend] ),
    SELECTCOLUMNS ( 'KPI', "Type", 'KPI'[Recieved] ),
    SELECTCOLUMNS ( 'KPI', "Type", 'KPI'[PO] ),
    SELECTCOLUMNS ( 'KPI', "Type", 'KPI'[PI] ),
    SELECTCOLUMNS ( 'KPI', "Type", 'KPI'[LI] )
)

 

Create a new table to dispaly the all available Type, and add calculated columns to count the Type with respective to each KPI. 

KPI3 = SUMMARIZE(KPI2,KPI2[Type])

Spend =
IF (
    LOOKUPVALUE ( 'KPI'[Count Spend], 'KPI'[Spend], KPI3[Type] ) = BLANK (),
    0,
    LOOKUPVALUE ( 'KPI'[Count Spend], 'KPI'[Spend], KPI3[Type] )
)

Recieved =
IF (
    LOOKUPVALUE ( 'KPI'[Count Recieved], 'KPI'[Recieved], KPI3[Type] ) = BLANK (),
    0,
    LOOKUPVALUE ( 'KPI'[Count Recieved], 'KPI'[Recieved], KPI3[Type] )
)

PI =
IF (
    LOOKUPVALUE ( 'KPI'[Count PI], 'KPI'[PI], KPI3[Type] ) = BLANK (),
    0,
    LOOKUPVALUE ( 'KPI'[Count PI], 'KPI'[PI], KPI3[Type] )
)

LI =
IF (
    LOOKUPVALUE ( 'KPI'[Count LI], 'KPI'[LI], KPI3[Type] ) = BLANK (),
    0,
    LOOKUPVALUE ( 'KPI'[Count LI], 'KPI'[LI], KPI3[Type] )
)

PO =
IF (
    LOOKUPVALUE ( 'KPI'[Count PO], 'KPI'[PO], KPI3[Type] ) = BLANK (),
    0,
    LOOKUPVALUE ( 'KPI'[Count PO], 'KPI'[PO], KPI3[Type] )
)

2.PNG

 

In report modeling, you can choose table visual to display above data view.

 

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.

@v-yulgu-msft: Thanks for your time. Let me try that.

Hi @Sunkari,

 

Have you resolved your issue? If above advice is helpful to your scenario, please kindly mark it as an answer so that more people having similar requirements can benifit from it. If you still have any question, please feel free to ask.

 

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.

@v-yulgu-msft Thanks for your help.  I hope your's best solution for this problem. I followed a different approach where i duplicated table for each KPI with two extra columns (KPIName, Value) and done a union all of those tables, used final table for reporting purpose.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors