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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
NandhiniNarasi
New Member

Need to Convert Complex DAX into New visual calculation

I have a report which is done by an existing power bi developer and it takes much time to load the report. There are so much of complex DAX formulas which are there. I wanted to convert thse dax into simple visual calculations and i dont have knowledge in visual calculations. How can i achieve this? I have 100's of DAX formulas like this. Kindly help.

Ex:

Est GrossProfit % = DIVIDE([$ Sales True GP OE], ROUND([$ Net OE], 4))
// VAR MaxPeriod = IF(HASONEVALUE(PeriodPPP[PERIOD]), SELECTEDVALUE(PeriodPPP[PERIOD]), MAX ( PeriodPPP[PERIOD] ) )
// VAR InvoicedOrders =
//     CALCULATETABLE(
//         OSBG,
//         FinCalendar[FinYearMonthOrdinal] <= VALUE(MaxPeriod),
//         OSBG[OEFlag] in {"B", "P", "R", "F"}
//     )
// VAR Result =
//     CALCULATE(
//         DIVIDE([$ Sales True GP OE], [$ Net OE]),
//         FinCalendar[FinYearMonthOrdinal] <= VALUE(MaxPeriod)
//     )
// RETURN
//     Result
3 REPLIES 3
Demert
Resolver II
Resolver II

Hi @NandhiniNarasi ,

could you give more info about what you are trying to achieve. Currently when I look at the dax measure it's only 1 line of code which references 2 other measures where we don't know if those measures are optimized. All the other lines are commented out (//). If you visuals are loading slow, there can be many different factors to it. A lot of measures inside the visuals, many data to process, not optimized dax code....

Hi Thanks for your quick response. Actually i have a report and as you said its loading very slow and there are so much of DAX calculations in the report. Now my TL has asked me to convert it as a paginated report and add visual calcualtions in it, to improve the performance of the report. but im not sure how to do that.

Hi @NandhiniNarasi  ,
Thanks for reaching out to the Microsoft fabric community forum.

First select any visual of your choice from visual pane

vnmadadimsft_0-1750824733377.png

 

 

vnmadadimsft_1-1750824733379.png

then Visual calculation will be available to use after selecting any visual of your choice ( not all visuals are supported for visual calculation)

vnmadadimsft_2-1750824812120.png

 

 

vnmadadimsft_3-1750824824867.png

 


Using Custom visual calculation you can run any DAX of your choice.

Please check this article to know more about visual calculation
Using visual calculations in Power BI Desktop - Power BI | Microsoft Learn
This will help you in converting DAX measures to Visual calculation

Also make a note that  visual calculations work within the confines of the visual matrix, functions that rely on model relationships such as USERELATIONSHIPRELATED or RELATEDTABLE aren't available.

If this post helps, then please consider Accepting as solution to help the other members find it more quickly and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you






Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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