The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Having an issue with my Count and totals
Issue #1.
Trying to take the count of the Status with "Ready" of orders by date. The fact table contains the Order # and the date and status.
I am using Distinct count since the fact will have order and line details also.
Order No | Total Price | Sum of Freight | Weight |
10003 | $77,500 | 45 | 10878 |
10005 | $110,375 | 45 | 10878 |
Total | 187,875 | 45 | 10878 |
Order No | Total Price | Sum of Freight | Weight |
10003 | $77,500 | 45 | 2250 |
10005 | $110,375 | 45 | 1300 |
Total | 187,875 | 90 | 3550 |
Attaching my pbix.
https://drive.google.com/file/d/1FvG6KSw16V0rmq_N6Mf-DRHr1rNI0KRJ/view?usp=sharing
Solved! Go to Solution.
@Anonymous See the attached pbix below my signature and explanation below for what I have done.
Issue 1
You are doing a distinctcount on status, and filtering for 1 status ="Ready", so the result will always be 1 or zero.
Try doing a DISTINCTCOUNT(Fact[OrderNo]) instead, or if you have a Order table you could COUNTROWS on that table, but in that case your filter might get more complex. So the simple solution is:
Issue 2
You need relationships between Orders and Fact table. I have not related Orders Detail as it looks like your fact table has all that info so Orders Detail is redundant?
See if these three posts help with relating your data: https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power_92.html
Once you have the tables related properly, you can use a measure such as:
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@Anonymous See the attached pbix below my signature and explanation below for what I have done.
Issue 1
You are doing a distinctcount on status, and filtering for 1 status ="Ready", so the result will always be 1 or zero.
Try doing a DISTINCTCOUNT(Fact[OrderNo]) instead, or if you have a Order table you could COUNTROWS on that table, but in that case your filter might get more complex. So the simple solution is:
Issue 2
You need relationships between Orders and Fact table. I have not related Orders Detail as it looks like your fact table has all that info so Orders Detail is redundant?
See if these three posts help with relating your data: https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power_92.html
Once you have the tables related properly, you can use a measure such as:
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
User | Count |
---|---|
81 | |
81 | |
37 | |
34 | |
31 |
User | Count |
---|---|
94 | |
80 | |
60 | |
50 | |
49 |