Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi All,
I have an issue with my measure in Power BI. I created the measure below:
Retail Margin = [Retail Value]*0.4
The Retail Value measure is written as:
Retail Value = SUMX(RetailValue,RetailValue[Market Size]*RetailValue[Musashi Market Share])
I am getting the correct answer but the problem is when i put it in a matrix opposite the header Retail Margin, it is not coming up. Instead, it is showing opposite the Retail Value header. I am sure this has something to do with the context but I cannot just figure how to make it work. My end goal is to have the yellow value to be showing in the blue field.
I wanted to attach the pbix file but I can't. Not sure how to do it or if it is even possible.
I will really any feedback that will point me to the right direction in solving this.
Thanks
LarsAustin
Solved! Go to Solution.
HI @LarsAustin,
You can try to use the following measure expressions to replace raw measure formulas:
Retail Margin =
VAR currHeader =
SELECTEDVALUE ( Header1[Header Account] )
VAR headerID =
CALCULATETABLE (
VALUES ( Header1[Header ID] ),
FILTER ( ALL ( Header1 ), [Header Account] = "Retail Value" )
)
VAR accountID =
CALCULATETABLE (
VALUES ( AccountMaster[Account ID] ),
FILTER ( ALLSELECTED ( AccountMaster ), [Header ID] IN headerID )
)
RETURN
IF (
currHeader = "(-) Retail Margin Assumption"
|| currHeader = BLANK (),
CALCULATE (
[Retail Value] * .4,
FILTER ( ALLSELECTED ( RetailValue ), [Account ID] IN accountID )
)
)
Regards,
Xiaoxin Sheng
@LarsAustin , can you upload the pbix on dropbox or onedrive and share the link
HI @LarsAustin,
You can try to use the following measure expressions to replace raw measure formulas:
Retail Margin =
VAR currHeader =
SELECTEDVALUE ( Header1[Header Account] )
VAR headerID =
CALCULATETABLE (
VALUES ( Header1[Header ID] ),
FILTER ( ALL ( Header1 ), [Header Account] = "Retail Value" )
)
VAR accountID =
CALCULATETABLE (
VALUES ( AccountMaster[Account ID] ),
FILTER ( ALLSELECTED ( AccountMaster ), [Header ID] IN headerID )
)
RETURN
IF (
currHeader = "(-) Retail Margin Assumption"
|| currHeader = BLANK (),
CALCULATE (
[Retail Value] * .4,
FILTER ( ALLSELECTED ( RetailValue ), [Account ID] IN accountID )
)
)
Regards,
Xiaoxin Sheng
Thank you so much. Works perfectly!
Cheers
LarsAustin
User | Count |
---|---|
76 | |
74 | |
61 | |
61 | |
45 |
User | Count |
---|---|
108 | |
103 | |
93 | |
83 | |
64 |