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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
fmigg
New Member

Problem on Data Filter on Table.

Hi,

I'm doing a self-purpose dashboard in which I have to filter expenses from 9 of actual month to 8 of the next month.

This is my formula: 

 

CC- Total a Pagar = IF(DAY(TODAY()) > 8,    
CALCULATE(
        SUM(Gastos[Cantidad]),
        DATESBETWEEN(Gastos[Fecha], DATE(YEAR(TODAY()), MONTH(TODAY()), 9), DATE(YEAR(TODAY()), MONTH(TODAY())+1, 8)),
        Gastos[Forma de Pago] = "CC"    ),    

CALCULATE(
        SUM(Gastos[Cantidad]),
        DATESBETWEEN(Gastos[Fecha], DATE(YEAR(TODAY()), MONTH(TODAY())-1, 9), DATE(YEAR(TODAY()), MONTH(TODAY()), 8)),
        Gastos[Forma de Pago] = "CC"    ))


The dataset started last month, so it has october and november data.  The DAX formula is giving me the expenses correctly,  problem is that it repeats the rows multiple times and associating them with non-expected dates. 

 

When I use the automatic hierachy for Gastos[Fecha], it just return the correct number of rows, but that generates four columns and I just want one.
1.PNG

 That's why I decided to turn off the hierachy, but the three row values gets repeated with different dates. As you can see, the total is right, but I don't know why all these rows are added.

2.PNG

 

I checked on the dataset and these extra rows does not exists. 

I don't understand why is this happening. 

 

Regards,

4 REPLIES 4
themistoklis
Community Champion
Community Champion

@fmigg

 

The tables that you create are aggregated tables.

 

They aggregate the measures based on the dimensions you specify.

On the first table if you want to see 1 row only then you have to remove the dimensions 'Day', 'Tipo de Custo'and 'Detalles Luggar' from the table itself.

v-lili6-msft
Community Support
Community Support

hi, @fmigg

After my test, It is because that you drag field date into visual and it could be aggregated,

so it will display multi-row data.

You may try this way

add a measure

type = 
IF (
    DAY ( TODAY () ) > 8,
    "from 9 of actual month to 8 of the next month",
    "from 8 of last month to 8 of the actual  month"
)

then drag into visual instead of the date field.

12.JPG

 

Best Regards,
Lin

 

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

Hi,

 

Could you share your PBI file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
affan
Solution Sage
Solution Sage

Hi @fmigg

 

I belive you can use the hierarchy and remove the Year, Quarter and Day

Data Filter on Table.gif

 

 

If this helped you, please mark this post as an accepted solution and like to give KUDOS .

 

Regards,

Affan

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.