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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
jisaenz
Helper I
Helper I

Issue with matrix in Power BI Desktop

Using Power BI Desktop April 2024 I have an issue when I use a measure as a value in matrix that contain additional values the matrix displys the values for the measure but is showing blanks for the other values. The measure that I am using is PO Next Weeks = VAR SelectedWeeks = SELECTEDVALUE('Weeks to include'[Weeks To Include]) VAR CurrentPeriodID = SELECTEDVALUE(Week_Site_Part_Periods[Period_ID]) VAR Result = CALCULATE( SUM('Purchase Orders'[PO]), ALL(Week_Site_Part_Periods[Period_ID]), Week_Site_Part_Periods[Period_ID] + 1 > CurrentPeriodID && Week_Site_Part_Periods[Period_ID] + 1 <= CurrentPeriodID + SelectedWeeks ) RETURN(IF(ISBLANK(Result), 0, Result))

6 REPLIES 6
bchager6
Super User
Super User

@jisaenz  I have a few questions: I assume the 'Purchase Orders'[PO] field contains a dollar amount? Why are you using the ALL function in the Result variable?

 

Those are the results in the matrix withouth the PO Next Weeks

jisaenz_0-1713197238418.png

 

this is the result whn I include the measure in the matrix

jisaenz_0-1713197136698.png

 

 

PO is qunatity with 0 decimals I am using all in the Result to allow me to use all Period_ID diffrent tahn the actual selected Period_ID

Still showing other coulmns in balnk and display the same values for PO Next Weeks 664227 with all shows the currect numbers

Sahir_Maharaj
Super User
Super User

Hello @jisaenz,

 

Can you please try the following:

PO Next Weeks = 
VAR SelectedWeeks = SELECTEDVALUE('Weeks to include'[Weeks To Include])
VAR CurrentPeriodID = SELECTEDVALUE(Week_Site_Part_Periods[Period_ID])
VAR Result = CALCULATE(
    SUM('Purchase Orders'[PO]),
    ALLEXCEPT(Week_Site_Part_Periods, Week_Site_Part_Periods[SomeOtherColumn]),
    Week_Site_Part_Periods[Period_ID] + 1 > CurrentPeriodID && 
    Week_Site_Part_Periods[Period_ID] + 1 <= CurrentPeriodID + SelectedWeeks
)
RETURN IF(ISBLANK(Result), 0, Result)


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?
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.