Power BI Accelerator: Master Data Analysis and Visualization Question on Lesson 81

Hey Guys,

Thank you for this awesome course!! I have never learnt so much from doing a Power BI course than this course. I was following along with the example from the course and reached Lesson 81 - Advanced Filtering and Branching in DAX. I was working on the Transaction w/Low Inventory Dax Measure and was able to replicate it and understand the logic perfectly as to what is trying to be achieved. Only problem is I get on results when doing this measure. Sam got results and I cannot work out how he got the results. ie I cannot replicate it first in Excel or in Power BI. I have tried many different things!! I tried to do the formula without using branching measures. ie I tried doing it by using the actual columns from the tables and trying to reproduce the results for each part but I get the same result nothing comes up. I tried some other calculations using firstly all the same tables in a DAX measure so I did a count of transactions based on something else from the Sales table and I get results for this. But when I try another DAX measure using measures from the Sales and Inventory tables I get no results so its making me think it may be a Relationship issue. I checked all the relationships I have and they match the relationships from the worked example as per what Sam had.

I was able to open the completed file that comes in the resources pack and was able to bring in the Transactions w/Low Inventory measure and it works perfectly. So I am lost I cant figure out why it will not work on my file I created.

I did not use any templates or anything that came in resource pack, apart from the background to make it look like the template file Sam was using. All other things I did manually, including the Date table and all the measures and measure folders and the original measures table to create the placeholder for where the measures and sub folders will be stored.

I am absolutely loving this course and doing the material and trying to replicate it with real life stuff where I can. I hope that someone can help me with this issue and please explain to me the reasoning behind how the measure in question works and how the transaction numbers for each stock code are arrived at, because I have no idea how to replicate this and to reason it out in my head. eg Item No. STK-100 has 121 transactions in the Sales table. The Total Value in the Inventory table for STK-100 is 7740. But in Sams example this measure returns 11 for Total Value > 50000. But dont these belong to other Item Numbers?? How can STK-100 have 11 transactions that relate to a Total Value of over 50000??
Beginner Guide To Power BI Demo_v1.1.pbix (727.5 KB)

Thanking you all in advance and keep up the good work.

Hi @lsalzone73,

Welcome to Forum.

It’s hard to tell on which Course / Lesson that you referencing from ?
Maybe to provide a link?

But from what are you describing and from your pbix it is obvious that you try to calculate from one table, filtering on another which has no relationship

If you in

Total Transactions = COUNTROWS('Sales Data')

instead of Sales data put Inventory Data → you will get result
but how to solve your problem ?

Try to use if statement instead of calculate and filter

if ([Inventory Value] < 50000,[Total Transactions], BLANK())

Hope that is what are you looking for.

If not - please provide more info about what are you need and about exact course ?
Thank you

Hey Maja

Thank you for the reply and help.

https://www.udemy.com/course/ultimate-beginners-guide-to-power-bi-part-2/learn/lecture/39157350#overview

This is a link to the Udemy course and lesson where Sam uses the formula and it works for him fine using the formula that I provided. I will try the solutions you provided. But it would be nice to see why the DAX works fine for Sam and why I cannot get it to work.

Problem is the Sales table has the actual Transactions and Inventory Data is the stock so I cant use the Inventory Data as it is not the actual Transactions.

Thank you.

Hi @lsalzone73 ,

True - you could not use Inventory Data for Transactions - i just put it as example so you can see where the problem is - try to calculate data from one table, filtering by another which has no relationship between.

Sorry I do not have access to this Udemy course. So I could not check Sam’s exact example.

You need to use different approach.