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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Chava1881
Helper II
Helper II

Duplicated Calculation / Leave only one row of data on measures

Hello,

 

I am working on a dashboard that will serve to compare information for two different systems at work that should have the same information and need to measure the variation; however, as calculation is the same and I am using a matrix, the values for the measures are duplicated and I just one to leave one, the other portion could be blanked out.

 Code and screenshot below:

Any help on this? 

Chava1881_0-1601411859132.png

 

Measure code:

% Variation Dec-2020 = (DIVIDE(
CALCULATE(
SUM(Data[Dec-2020]),
Data[Key Figure] = "Dependent Demand"
),
CALCULATE(
SUM(Data[Dec-2020]),
Data[Key Figure] = "Samurai Actuals/Gross Fcst"
)
)) -1

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Chava1881,

 

Try this measure. I rewrote it with variables for readability.

 

% Variation Dec-2020 = 
VAR vKeyFigure =
    MAX ( Data[Key Figure] )
VAR vDepDemand =
    CALCULATE ( SUM ( Data[Dec-2020] ), Data[Key Figure] = "Dependent Demand" )
VAR vSamurai =
    CALCULATE (
        SUM ( Data[Dec-2020] ),
        Data[Key Figure] = "Samurai Actuals/Gross Fcst"
    )
VAR vResult =
    DIVIDE ( vDepDemand, vSamurai ) - 1
RETURN
IF ( vKeyFigure = "Dependent Demand", BLANK (), vResult )

 

DataInsights_0-1601505060226.png

 





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
v-diye-msft
Community Support
Community Support

Hi @Chava1881 

 

If the above posts help, please kindly mark it as a answer to help others find it more quickly. thanks!

If not, please kindly elaborate more.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
DataInsights
Super User
Super User

@Chava1881,

 

Try this measure. I rewrote it with variables for readability.

 

% Variation Dec-2020 = 
VAR vKeyFigure =
    MAX ( Data[Key Figure] )
VAR vDepDemand =
    CALCULATE ( SUM ( Data[Dec-2020] ), Data[Key Figure] = "Dependent Demand" )
VAR vSamurai =
    CALCULATE (
        SUM ( Data[Dec-2020] ),
        Data[Key Figure] = "Samurai Actuals/Gross Fcst"
    )
VAR vResult =
    DIVIDE ( vDepDemand, vSamurai ) - 1
RETURN
IF ( vKeyFigure = "Dependent Demand", BLANK (), vResult )

 

DataInsights_0-1601505060226.png

 





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

Proud to be a Super User!




This works perfectly, thank you!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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