Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
DinEileen
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
v-jianboli-msft
Community Support
Community Support

Hi @DinEileen ,

 

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

vjianbolimsft_0-1668411387327.png

Please try:

% 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:

vjianbolimsft_1-1668411429706.png

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.

View solution in original post

3 REPLIES 3
v-jianboli-msft
Community Support
Community Support

Hi @DinEileen ,

 

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

vjianbolimsft_0-1668411387327.png

Please try:

% 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:

vjianbolimsft_1-1668411429706.png

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.

mangaus1111
Solution Sage
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]?

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])

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.