In this case, I’m seeking to count any Company ID that meets the criteria for exceeding a fixed amount (in this case, the simple criterion of “Total Minutes” > 2000). But the DAX formula is skipping rows where the criterion is plainly met:
I have tried specifying additional table granularity, but that attempt results in an error:
Thanks for pointing that out. I have uploaded an anonymized mock-up PBIX file, which summarizes the problem (#1) in its own Report Page. It also simulates the solution. Goal is to display the total in a Power BI Card view. Another problem, perhaps related, is shown in the second report page. Thanks in advance!
Thanks for uploading your file.
You just need to use measures instead of calculated columns.
What I did is that I create a new measure called “Total Minutes Hossein” using your calculated column “Total Minutes_m”, and then used it in the “Developers Engaged-Hossein” measure.
I hope it would be helpful.
Total Minutes Hossein =
SUM( ‘Data Model _ mock’[Total Minutes_m] )
Thanks Hossein, works beautifully. (I do need to gain a better understanding of when to use column calculations versus DAX measures). One more thing: How do I hard-code a fixed Date filter (of > 5/15/20) into the DAX measure itself, so that setting a Pane filter criterion can be avoided? Somehow, my syntax must be wrong. Also, see below re: additional problem (#3) of applying a second filter criterion:
In addition (per an update of your PBIX file), I’m not able to add another criterion whereby “InTrial” column = 0. This issue is explained in Page 3. Thanks!
It’s great to know that you are making progress with your query @mdalton2100 . Please don’t forget if your question has been answered within the forum it is important to mark your thread as ‘solved’. Also, we’ve recently launched the Enterprise DNA Forum User Experience Survey, please feel free to answer it and give your insights on how we can further improve the Support forum. Thanks!
Dear mdalton2100
This is so easy in Power BI to filter dates in a measure. You just need to add a line to your code. I did It as you can see below, but the answer was 92 showing that I did not get the right answer (85). The result of the measure I wrote is different from what you got by using filter pane.
I used this code for your example:
In the last line of the above code, I filtered the date table for the dates on or after 2020/05/15.
I dont know why it doesn’t work but I hope you will find the right answer.
Thanks again. Per the validation visual below, I believe the correct answer is “69”. When I apply the usual filter pane parameters to your latest measure, the 95 then changes to 69, as shown below. Could it be my validation visual is not a valid benchmark? I have re-uploaded the updated PBIX file.Data Model with Mockup - Hossein.pbix (3.0 MB)
I have replicated what you are doing using Visual level filters . Please find explanation below
__BaseTable = To Create a Virtual table after applying InTrial and Date filters on Mockup table.
__FinalTable - From Filtered table, I am extracting CompanyID with minutes greater than 2000.
First using SUMMARIZE to Group by CompanyID and find Sum of minutes. Then Filter to extract only those CompanyID with Sum of Minutes > 2000
Last Step in Return is calculate to extract DistinctCount of Customers from __FinalTable.