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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
powerbi2srm
Resolver II
Resolver II

Date filter not working in a conditional measure

Hi, I created this measure but when I filter with a slicer by date, it doesn't work properly and Power Bi shows all data:

 

check_balance = 
VAR debit = 
SUM(fact_accounting_move_line[debit])

VAR credit = 
SUM(fact_accounting_move_line[credit])

VAR conditional =
IF(
    ROUND(debit - credit,2) = 0,
    "Cuadrado",
    "Descuadre"
)
RETURN conditional

 

Captura2.PNG                    Captura.PNG

The problem is in the conditional because when I try with variables "debit" or "credit" it works correctly. Does anyone know what could be going wrong?

Thank you!!

 

P.D.: My issue is exactly this: Filter Not working Properly after Applying if cond... - Microsoft Power BI Community

 

1 ACCEPTED SOLUTION
Payeras_BI
Solution Sage
Solution Sage

Hi @powerbi2srm ,
In the other issue you mentioned above that was the proposed pattern: 

 

IF (
        ISEMPTY ('fact_accounting_move_line'),
        BLANK (),
        IF(ROUND(debit - credit,2) = 0,"Cuadrado","Descuadre")
    )

 

I understand you have tried out and didn't work.

Please confirm.

Regards,

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

View solution in original post

12 REPLIES 12
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file and the source Excel file.  Share only the fact_accounting_move_line table in that PBI file.  Also, is the date format YMD or YDM?


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

Hi @powerbi2srm ,
In the other issue you mentioned above that was the proposed pattern: 

 

IF (
        ISEMPTY ('fact_accounting_move_line'),
        BLANK (),
        IF(ROUND(debit - credit,2) = 0,"Cuadrado","Descuadre")
    )

 

I understand you have tried out and didn't work.

Please confirm.

Regards,

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
powerbi2srm
Resolver II
Resolver II

Anyone can help me? Thank you so much @amitchandak@Greg_Deckler@Idrissshatila@Ashish_Mathur    

Anonymous
Not applicable

is move_line_date_id a data column? If not change it to that. If not i don't currently know why it wouldn't work.

 

Yes, it's of integer type.

Captura.PNG

@Anonymous  I just tried with other tables and I have the same problem. I don't understand.

Anonymous
Not applicable

DvdH_0-1674465792675.png

If this helps please kudo the post. If this gets you the solution please accept this incase anyone else could use this

Are u using Date or integer? U should use Date.

 

dim_date[date_id] and move_line_date_id are integer type but dim_date is a date table with date columns like formatted_date. With other measures works perfectly so I think that isn't the problem. Anyway thank you for your time.Captura.PNG

Anonymous
Not applicable

No problem, sorry i wasn't of any help. Good luck.

Anonymous
Not applicable

There would be the issue i think. Try transforming this to the "Date" I think its spanish u are currently in so it would be "fecha" the function u are using is reading is as a number aka integer. Which is not a Date type.

If this helps please kudo the post. If this gets you the solution please accept this incase anyone else could use this

It could be but move_line_date_id (integer) is related with dim_date[date_id] (integer) and dim_date is a date table. For other measures I don't have this problem. It's just this. 

Anonymous
Not applicable

I am personally not an expert but for now could u try a workaround such as creating a new column which is identical to the move_line_date_id as date type just incase this is the issue. If the error persists update the post with your attempts so others can give different advice. If it is not the issue i don't think i can assist further myself.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.