Forum Discussion
Jessica_17
2 months agoHelper V
Custom Matrix Visual
Hi Team, I need support in implementing the following requirement in Power BI using DAX. Source Data The data is received from Excel in a monthly format with columns such as: Date BU WBS ...
- 2 months ago
Hi Jessica_17 ,
Thank you for reaching out to the Microsoft Community Forum. Please refer below output snap and attached .pbix file.
Please refer below main measures.
Test Month Value =VAR CurrentBU =SELECTEDVALUE ( Fact[BU] )RETURNSWITCH (TRUE (),CurrentBU IN { "G", "L" },[Current Cum Allocation]- COALESCE ( [Previous Cum Allocation], 0 ),[GC])Allocated Amount =SWITCH (TRUE (),ISINSCOPE ( Fact[WBS] )&& ISINSCOPE ( Fact[Financial Month] ),[Test Month Value],ISINSCOPE ( Fact[WBS] )&& NOT ISINSCOPE ( Fact[Financial Month] ),SUMX (VALUES ( Fact[Financial Month] ),CALCULATE ( [Test Month Value] )),ISINSCOPE ( Fact[BU] )&& ISINSCOPE ( Fact[Financial Month] ),SUMX (VALUES ( Fact[WBS] ),CALCULATE ( [Test Month Value] )),ISINSCOPE ( Fact[BU] )&& NOT ISINSCOPE ( Fact[Financial Month] ),SUMX (VALUES ( Fact[WBS] ),CALCULATE (SUMX (VALUES ( Fact[Financial Month] ),CALCULATE ( [Test Month Value] )))),SUMX (VALUES ( Fact[BU] ),CALCULATE (SUMX (VALUES ( Fact[WBS] ),CALCULATE (SUMX (VALUES ( Fact[Financial Month] ),CALCULATE ( [Test Month Value] )))))))I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
v-dineshya
2 months agoCommunity Support
Hi Jessica_17 ,
Thank you for reaching out to the Microsoft Community Forum. Please refer below output snap and attached .pbix file.
Please refer below main measures.
Test Month Value =
VAR CurrentBU =
SELECTEDVALUE ( Fact[BU] )
RETURN
SWITCH (
TRUE (),
CurrentBU IN { "G", "L" },
[Current Cum Allocation]
- COALESCE ( [Previous Cum Allocation], 0 ),
[GC]
)
Allocated Amount =
SWITCH (
TRUE (),
ISINSCOPE ( Fact[WBS] )
&& ISINSCOPE ( Fact[Financial Month] ),
[Test Month Value],
ISINSCOPE ( Fact[WBS] )
&& NOT ISINSCOPE ( Fact[Financial Month] ),
SUMX (
VALUES ( Fact[Financial Month] ),
CALCULATE ( [Test Month Value] )
),
ISINSCOPE ( Fact[BU] )
&& ISINSCOPE ( Fact[Financial Month] ),
SUMX (
VALUES ( Fact[WBS] ),
CALCULATE ( [Test Month Value] )
),
ISINSCOPE ( Fact[BU] )
&& NOT ISINSCOPE ( Fact[Financial Month] ),
SUMX (
VALUES ( Fact[WBS] ),
CALCULATE (
SUMX (
VALUES ( Fact[Financial Month] ),
CALCULATE ( [Test Month Value] )
)
)
),
SUMX (
VALUES ( Fact[BU] ),
CALCULATE (
SUMX (
VALUES ( Fact[WBS] ),
CALCULATE (
SUMX (
VALUES ( Fact[Financial Month] ),
CALCULATE ( [Test Month Value] )
)
)
)
)
)
)
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
Jessica_17
2 months agoHelper V
Thanks v-dineshya ,
It worked for me.