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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Hugo999
Frequent Visitor

KPI on region-lvl, vs. branch lvl

Hi everyone,

I have the following table:

 

branch | Region | month | kpi1 | kpi2 | kpi3 | kpi4 | monkst_KPI
--------|---------|---------|------|------|------|-------|-----------
001      | regi1   | 2212     | 0 | 0 | 0 | 0.00% | 2212_802
002      | regi1   | 2212     | 0 | 0 | 0 | 0.00% | 2212_1313
003      | regi2   | 2404     | 0 | 0 | 0 | 0.00% | 2404_493
004      | regi2   | 2404     | 0 | 0 | 0 | 0.00% | 2404_6852

123      | regi3   | 2312     | 0 | 0 | 0 | 0.00% | 2312_2280
555      | regi3   | 2410     | 0 | 0 | 0 | 0.00% | 2410_6791

etc

 

Field Explanation:

  • KPI1-KPI4 = calculated KPI values (currently all 0)
  • monKST_KPI = a concatenated key (month + KST), used as a foreign key in the data model

Currently, I have a working line chart at the KST level (one KPI vs. months). The X-axis shows months, the Y-axis shows the KPI (e.g., kpi1), and a slicer allows me to select which KST I want to display.

My question: How can I create a line chart at the Region level for adding this region-level KPI line into the same line chart? Essentially, I want to compare how the KPI for a single KST develops over time vs. the KPI for the entire region that the KST belongs to.

Any insights or guidance on setting this up would be much appreciated!

Thanks in advance!



1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from Sahir_Maharaj.

 

Hi @Hugo999 ,

 

I created two more tables to use as slicers:

vlinhuizhmsft_0-1737613499372.png

vlinhuizhmsft_1-1737613525337.png

 

Then create two measures:

Single KST = 
VAR _region = SELECTEDVALUE('Region_slicer'[Region])
VAR _kpi = SELECTEDVALUE('KPI_slicer'[kpi])
RETURN
CALCULATE(
    SWITCH(
        _kpi,
        "kpi1", SUM('Table'[kpi1]),
        "kpi2", SUM('Table'[kpi2]),
        "kpi3", SUM('Table'[kpi3]),
        "kpi4", SUM('Table'[kpi4])
    ),
    'Table'[Region] = _region
)
All KST = 
VAR _kpi = SELECTEDVALUE('KPI_slicer'[kpi])
RETURN
CALCULATE(
    SWITCH(
        _kpi,
        "kpi1", SUM('Table'[kpi1]),
        "kpi2", SUM('Table'[kpi2]),
        "kpi3", SUM('Table'[kpi3]),
        "kpi4", SUM('Table'[kpi4])
    ),
    REMOVEFILTERS('Table'[Region])
)

 

Create two slicers to dynamically switch kpi and region. Result:

vlinhuizhmsft_2-1737613966853.png

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Hugo999 ,

 

Have you solved your problem? If it is solved, please share your solution and accept it as solution or mark the helpful replies, it will be helpful for other members of the community who have similar problems as yours to solve it faster. Thank you very much for your kind cooperation!

 

Best Regards,
Zhu

Anonymous
Not applicable

Thanks for the reply from Sahir_Maharaj.

 

Hi @Hugo999 ,

 

I created two more tables to use as slicers:

vlinhuizhmsft_0-1737613499372.png

vlinhuizhmsft_1-1737613525337.png

 

Then create two measures:

Single KST = 
VAR _region = SELECTEDVALUE('Region_slicer'[Region])
VAR _kpi = SELECTEDVALUE('KPI_slicer'[kpi])
RETURN
CALCULATE(
    SWITCH(
        _kpi,
        "kpi1", SUM('Table'[kpi1]),
        "kpi2", SUM('Table'[kpi2]),
        "kpi3", SUM('Table'[kpi3]),
        "kpi4", SUM('Table'[kpi4])
    ),
    'Table'[Region] = _region
)
All KST = 
VAR _kpi = SELECTEDVALUE('KPI_slicer'[kpi])
RETURN
CALCULATE(
    SWITCH(
        _kpi,
        "kpi1", SUM('Table'[kpi1]),
        "kpi2", SUM('Table'[kpi2]),
        "kpi3", SUM('Table'[kpi3]),
        "kpi4", SUM('Table'[kpi4])
    ),
    REMOVEFILTERS('Table'[Region])
)

 

Create two slicers to dynamically switch kpi and region. Result:

vlinhuizhmsft_2-1737613966853.png

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

Sahir_Maharaj
Super User
Super User

Hello @Hugo999,

 

Can you please try this approach:

Region vs Branch KPI = 
VAR CurrentBranchKPI = 
    CALCULATE(
        AVERAGE('Table'[KPI1]),
        FILTER(
            'Table',
            'Table'[branch] = SELECTEDVALUE('Table'[branch])
        )
    )
VAR CurrentRegionKPI = 
    CALCULATE(
        AVERAGE('Table'[KPI1]),
        FILTER(
            'Table',
            'Table'[Region] = SELECTEDVALUE('Table'[Region])
        )
    )
RETURN
    SWITCH(
        TRUE(),
        ISINSCOPE('Table'[branch]), CurrentBranchKPI,
        ISINSCOPE('Table'[Region]), CurrentRegionKPI,
        BLANK()
    )

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.