Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello there,
I am new to power bi. I want to transfer a financial report with a very strict and specific format into power bi. So I have created a table called 'Template' with 3 columns, 'Description', 'Row', and 'GL code'. The description is what the user wants to see, the row is the row number according to Excel. Also, I have a table called Data which has these columns: 'Amount', 'Date', and 'GL Code'.
| Row | GL Code | Description |
| 1 | 890 | Product 1 |
| 2 | 871 | Product 2 |
| ... | ... | ... |
| 31 | null | Total Product 1 +2 |
Data Table:
| Date | GL Code | Amount |
| 1/1/2023 | 871 | 1.40 |
| 1/1/2023 | 890 | 2.80 |
| 2/1/2023 | 890 | 2.80 |
Some rows have to do some sum based on GL Code. For example, when the row number is 31, they must sum the amount with GL Codes 890 and 871.
So, I wrote a DAX code like this:
It works when I don't use slicers but they give the total for the whole dates. When I use the slicer with Date, it always returns the value 0. What can cause that?
Any help is appreciated.
Thanks in advance
Solved! Go to Solution.
Hi @reltakeasy ,
You can update the formula of your measure as below, please find the details in the attachment.
Measure =
IF (
SELECTEDVALUE ( 'Template'[Row] ) = 31,
CALCULATE (
SUM ( 'Data'[Amount] ),
FILTER ( 'Data', 'Data'[GL Code] IN { 890, 871 } )
),
CALCULATE (
SUM ( 'Data'[Amount] ),
FILTER ( 'Data', 'Data'[GL Code] = SELECTEDVALUE ( 'Template'[GL Code] ) )
)
)Measure =
IF (
SELECTEDVALUE ( 'Template'[Row] ) = 31,
CALCULATE (
SUM ( 'Data'[Amount] ),
FILTER ( 'Data', 'Data'[GL Code] IN { 890, 871 } )
),
CALCULATE (
SUM ( 'Data'[Amount] ),
FILTER ( 'Data', 'Data'[GL Code] = SELECTEDVALUE ( 'Template'[GL Code] ) )
)
)
Best Regards
Hi @reltakeasy ,
You can update the formula of your measure as below, please find the details in the attachment.
Measure =
IF (
SELECTEDVALUE ( 'Template'[Row] ) = 31,
CALCULATE (
SUM ( 'Data'[Amount] ),
FILTER ( 'Data', 'Data'[GL Code] IN { 890, 871 } )
),
CALCULATE (
SUM ( 'Data'[Amount] ),
FILTER ( 'Data', 'Data'[GL Code] = SELECTEDVALUE ( 'Template'[GL Code] ) )
)
)Measure =
IF (
SELECTEDVALUE ( 'Template'[Row] ) = 31,
CALCULATE (
SUM ( 'Data'[Amount] ),
FILTER ( 'Data', 'Data'[GL Code] IN { 890, 871 } )
),
CALCULATE (
SUM ( 'Data'[Amount] ),
FILTER ( 'Data', 'Data'[GL Code] = SELECTEDVALUE ( 'Template'[GL Code] ) )
)
)
Best Regards
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 52 | |
| 42 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 107 | |
| 104 | |
| 39 | |
| 35 | |
| 25 |