Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet 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
Hello DAXperts,
I have a matrix visual showing my data from a "MainData" table.
I have been able to display % numbers for selected rows while the rest of the matrix is decimal formatted. But this only works within certain filtered contexts based on the selected slicers.
Ultimately, I have a Profit & Loss report, I want this report to show the correct calculated % values for the "Gross Profit %" row.
Currently, the data does contain the correct decimal values for the % equivalent number for "Gross Profit %". But the numbers are correct when only a single Business Unit is selected on the slicer.
Ideally, the GP% can be calculated by use of a measure or something similar (but I have not gone this route):
GP% = DIVIDE( CALCULATE( [PL], 'MainData'[L1] = "Gross Profit", CALCULATE( [PL], 'MainData'[L1] = "Revenue" ) )
The measure I really need help with is [ActualsPL w %] or [ComparisonPL w %].
See below image and attached PBIX file.
Any suggestions or workarounds is much appreciated!
Solved! Go to Solution.
Hi @Khang ,
Please modify the measure [ShowPL].
ShowPL =
IF( SELECTEDVALUE(Tbl_Glb_Show[Show]) = "YTD",
IF( SELECTEDVALUE( MainData[L1] ) = "Gross Profit %",
CALCULATE( [PL YTD], MainData[L1] = "Gross Profit" && MainData[Figures] = "Actuals") / CALCULATE( [PL YTD], MainData[L1] = "Revenue" && MainData[Figures] = "Actuals"),
CALCULATE( [PL YTD], MainData[Figures] = "Actuals")),
IF( SELECTEDVALUE( MainData[L1] ) = "Gross Profit %",
CALCULATE( [PL], MainData[L1] = "Gross Profit" && MainData[Figures] = "Actuals", ALLSELECTED(MainData)) / CALCULATE( [PL], MainData[L1] = "Revenue" && MainData[Figures] = "Actuals", ALLSELECTED(MainData)),
CALCULATE( [PL], MainData[Figures] = "Actuals"))
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Khang ,
Please modify the measure [ShowPL].
ShowPL =
IF( SELECTEDVALUE(Tbl_Glb_Show[Show]) = "YTD",
IF( SELECTEDVALUE( MainData[L1] ) = "Gross Profit %",
CALCULATE( [PL YTD], MainData[L1] = "Gross Profit" && MainData[Figures] = "Actuals") / CALCULATE( [PL YTD], MainData[L1] = "Revenue" && MainData[Figures] = "Actuals"),
CALCULATE( [PL YTD], MainData[Figures] = "Actuals")),
IF( SELECTEDVALUE( MainData[L1] ) = "Gross Profit %",
CALCULATE( [PL], MainData[L1] = "Gross Profit" && MainData[Figures] = "Actuals", ALLSELECTED(MainData)) / CALCULATE( [PL], MainData[L1] = "Revenue" && MainData[Figures] = "Actuals", ALLSELECTED(MainData)),
CALCULATE( [PL], MainData[Figures] = "Actuals"))
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Winniz,
This worked perfectly.
Thanks so much!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
25 | |
20 | |
20 | |
14 | |
13 |
User | Count |
---|---|
43 | |
37 | |
25 | |
24 | |
22 |