cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## % of with count & measure

Hi all,

this is my situation: I have a table with all the orders. I created a DAX measure to calculate the difference between order and the related offer. Now I want a DAX measure that tells me how many orders have no difference and how many orders have a difference to the offers.

I want to caclulcate the % of "no differences". Having it as a measure would enable me to see which salesman or which area etc has no differences and works maybe better etc.

So far I created this code but it didn't work:

% no-diff =
var bigTotal = countx(BI_Positionen_Orders,[Diff to Offer])
var ZeroCount = countx(BI_Positionen_Orders,[Diff to Offer]=0)
return Divide(ZeroCount,bigTotal)

Is it maybe better when I create a column "Diff to offer" instead of a measure?

Thanks and all the best 🙂

1 ACCEPTED SOLUTION
Community Support

Hi @DinEileen ,

Based on your description, I have created a simple sample:

``````% no-diff =
var bigTotal = countx(BI_Positionen_Orders,[Diff to Offer])
var ZeroCount = countx(FILTER('BI_Positionen_Orders',[Diff to Offer]=0),[Diff to Offer])
return Divide(ZeroCount,bigTotal)``````

Final output:

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Community Support

Hi @DinEileen ,

Based on your description, I have created a simple sample:

``````% no-diff =
var bigTotal = countx(BI_Positionen_Orders,[Diff to Offer])
var ZeroCount = countx(FILTER('BI_Positionen_Orders',[Diff to Offer]=0),[Diff to Offer])
return Divide(ZeroCount,bigTotal)``````

Final output:

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Solution Sage

Hi @DinEileen ,

can you send some sample data of your source table and tell me how is written the measure [Diff to Offer]?

Frequent Visitor

Hi @mangaus1111,

unfortunately the source data is all in german, so I don't know if that will help you and actually I don't know how to extract something there 😅

here is the code for Diff to Offer: [quantity]-sum(BI_Positionen_Orders[Qty predecessor document])

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors