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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Cardi0z
Helper I
Helper I

measure to calculate the total and display it on the single bar chart

 

CategoryPIR1PIR21st weekTotal MTDMiss OutputMTDFull MthPIR Rev
Liquid135,000129,00024,00024,000105,00018.60%100.00%-4.44%
Solid123,000123,50024,00024,00099,50019.43%100.00%0.41%

 

that is my table, I wanto to create bar chart base on value of

1. Y axis : Total MTD liquid/PIR2 liquid, Total MTD solid/PIR2 solid, Total MTD (liquid+solid)/Total PIR2 (solid+liquid)
2. Y axis : (Total MTD liquid+Miss Output liquid)/PIR2 Liquid, (Total MTD solid+Miss Output solid)/PIR2 solid, (Total MTD liquid&solid + Miss Output liquid&solid)/PIR2 Liquid&solid,

please help me how to do that

thank you

 

 

3 REPLIES 3
Cardi0z
Helper I
Helper I

Dear @Sahir_Maharaj , @rajendraongole1 



from the data source above, is it possible to create a chart like the screenshot below? how to calculate it?

Cardi0z_0-1717990646218.png

 

Sahir_Maharaj
Super User
Super User

Hello @Cardi0z,

 

Can you please try the following:

 

1. Total MTD / PIR2

MTD_PIR2_Liquid = 
DIVIDE(
    SUMX(FILTER(YourTable, YourTable[Category] = "Liquid"), YourTable[Total MTD]),
    SUMX(FILTER(YourTable, YourTable[Category] = "Liquid"), YourTable[PIR2])
)

MTD_PIR2_Solid = 
DIVIDE(
    SUMX(FILTER(YourTable, YourTable[Category] = "Solid"), YourTable[Total MTD]),
    SUMX(FILTER(YourTable, YourTable[Category] = "Solid"), YourTable[PIR2])
)

MTD_PIR2_Total = 
DIVIDE(
    SUMX(YourTable, YourTable[Total MTD]),
    SUMX(YourTable, YourTable[PIR2])
)

2. (Total MTD + Miss Output) / PIR2

MTD_MissOutput_PIR2_Liquid = 
DIVIDE(
    SUMX(FILTER(YourTable, YourTable[Category] = "Liquid"), YourTable[Total MTD] + YourTable[Miss Output]),
    SUMX(FILTER(YourTable, YourTable[Category] = "Liquid"), YourTable[PIR2])
)

MTD_MissOutput_PIR2_Solid = 
DIVIDE(
    SUMX(FILTER(YourTable, YourTable[Category] = "Solid"), YourTable[Total MTD] + YourTable[Miss Output]),
    SUMX(FILTER(YourTable, YourTable[Category] = "Solid"), YourTable[PIR2])
)

MTD_MissOutput_PIR2_Total = 
DIVIDE(
    SUMX(YourTable, YourTable[Total MTD] + YourTable[Miss Output]),
    SUMX(YourTable, YourTable[PIR2])
)

3. Create a new table

MeasureTable = 
UNION(
    SELECTCOLUMNS(
        FILTER(YourTable, YourTable[Category] = "Liquid"),
        "Category", "Liquid",
        "MTD_PIR2", [MTD_PIR2_Liquid],
        "MTD_MissOutput_PIR2", [MTD_MissOutput_PIR2_Liquid]
    ),
    SELECTCOLUMNS(
        FILTER(YourTable, YourTable[Category] = "Solid"),
        "Category", "Solid",
        "MTD_PIR2", [MTD_PIR2_Solid],
        "MTD_MissOutput_PIR2", [MTD_MissOutput_PIR2_Solid]
    ),
    SELECTCOLUMNS(
        YourTable,
        "Category", "Total",
        "MTD_PIR2", [MTD_PIR2_Total],
        "MTD_MissOutput_PIR2", [MTD_MissOutput_PIR2_Total]
    )
)

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

Dear @Sahir_Maharaj 

Cardi0z_0-1718004696313.png


why does the total value have 2 rows?

cc :
@Anonymous 
@Anonymous 
@Anonymous 
@Anonymous 

Helpful resources

Announcements
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.