March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I have this measure:
Let me know if there are any questions.
Thanks
Solved! Go to Solution.
Hi @Justas4478,
I'm using this data set:
And this is my measures:
Total Actual = SUM(T_Outbound[Actual])
Total Demand = SUM(T_Outbound[Demand])
Shorted = [Total Demand] - [Total Actual]
Count Shorted =
VAR _Table =
SUMMARIZE(
T_Outbound,
T_Outbound[Level 2],
T_Outbound[Date],
"@Shorted", [Shorted]
)
VAR _Result =
COUNTX(
FILTER(
_Table,
[@Shorted] <> 0
),
[@Shorted]
)
RETURN
_Result
The output is:
I hope this could solve your problem.
Proud to be a Super User!
Try this measure:
CALCULATE(
COUNT(T_OutboundDelivery[Shorted]),
T_OutboundDelivery[Shorted] <> 0
)
The final result would be this:
Proud to be a Super User!
@_AAndrade Hi, I am using measures since it is company controlled live connection model.
That is only thing I am able to create.
This is what I have in 'Outbound Delivery' table.
I created 'Shorted' measure using 'Total Demand' and 'Total Actual' measures.
But there are 'Demand' and 'Actual' hidden columns that would need to be summarised.
Idealy I would like the solution to work with the measures if possible.
Hi @Justas4478,
I'm using this data set:
And this is my measures:
Total Actual = SUM(T_Outbound[Actual])
Total Demand = SUM(T_Outbound[Demand])
Shorted = [Total Demand] - [Total Actual]
Count Shorted =
VAR _Table =
SUMMARIZE(
T_Outbound,
T_Outbound[Level 2],
T_Outbound[Date],
"@Shorted", [Shorted]
)
VAR _Result =
COUNTX(
FILTER(
_Table,
[@Shorted] <> 0
),
[@Shorted]
)
RETURN
_Result
The output is:
I hope this could solve your problem.
Proud to be a Super User!
@_AAndrade Hi, I have been using solution that you provided.
And it is great, there are only case when shorted qty is 0 it returns rezult blank when I would expect to return 0.
I tried to change <> to >= in the measure but that only change from this:
to this:
I am not sure which part I need to modify so the 1's that have shorted qty of 0 would return 0.
Thanks
@_AAndrade I think I manage to find the solution I added +0 to this part of the dax.
VAR _Result =
COUNTX(
FILTER(
_Table,
[@Shorted] <> 0
),
[@Shorted]
)+0
RETURN
_Result
Let me know if you think there is better way.
This is the result:
Great news.
Proud to be a Super User!
@_AAndrade It looks like it is working without any problems so far.
Thank you for the help.
Great.You're welcome.
Proud to be a Super User!
Hi @Justas4478,
You are using calculated columns, right?
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
126 | |
85 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |