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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
pradnya49
Frequent Visitor

How to write the measure to calculate scenario

Hello Everyone,

 

I have below power bi report

% of take place =liquidity/trans

here, trans will be same for all customer for a given month. so it is fixed.  

pradnya49_2-1690200697507.png

 

but  I dont need customer code and removed it from report and then report looks like:

pradnya49_3-1690201001131.png

 

as above % take place is wrong as it should be 70%120, how to achieve it ?  as I dont want to change trans column.

 

Can anybody help? Thanks in advance.

 

 

 

 

 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @pradnya49 

According to your description, you want to remove the [cutomer code] in your visual but the [trans] do not change due to it is fixed in the Month.

For your screenshot , i think the [trans] is a measure in your side. So i create a [trans Measure] in my side.

vyueyunzhmsft_0-1690338933276.png

We can create a measure like this:

% of take place = DIVIDE( SUM('Table'[liquidity]) ,DISTINCTCOUNT('Table'[customer code]) * [trans Measure]   )

 

Then we can put the measure on the visual and we can get the result as follows:

vyueyunzhmsft_1-1690338971319.png

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi , @pradnya49 

According to your description, you want to remove the [cutomer code] in your visual but the [trans] do not change due to it is fixed in the Month.

For your screenshot , i think the [trans] is a measure in your side. So i create a [trans Measure] in my side.

vyueyunzhmsft_0-1690338933276.png

We can create a measure like this:

% of take place = DIVIDE( SUM('Table'[liquidity]) ,DISTINCTCOUNT('Table'[customer code]) * [trans Measure]   )

 

Then we can put the measure on the visual and we can get the result as follows:

vyueyunzhmsft_1-1690338971319.png

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

Mkarwa-123
Resolver II
Resolver II

Hi @pradnya49 
You should do group by either using summarise or group by dax function. 

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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