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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
saivina2920
Post Prodigy
Post Prodigy

Problem while comparing the date in different periods for pie chart

I am creating different measure like (<10 days, 10 to 20 Days and >20 Days).

 

While applying the meaasure in pie chart values, i am getting erroras mentioned below.

 

sample test .PBIX file attached.

 

saivina2920_0-1616596478405.png

 

https://1drv.ms/u/s!AiSRcgO5FUmN8SEmIwIM57N3eobB?e=JC5V2l 

 

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @saivina2920 ,

As checked your sample pbix file, there are some syntax error in measure [10to20Days] and [LessThan10Days]. Please update them with the below formulas and check whether it can get the correct result:

Note: The part in red font is newly added.

10to20Days =
CALCULATE (
    DISTINCTCOUNT ( EMP_TABLE[EMP_NO] ),
    FILTER (
        EMP_TABLE,
        EMP_TABLE[EMP_RESIGN_DATE] >= EMP_TABLE[vCalDate20]
            && EMP_TABLE[EMP_RESIGN_DATE] <= EMP_TABLE[vCalDate10]
            && EMP_TABLE[EMP_STATUS] = "Working"
    )
)
LessThan10Days =
CALCULATE (
DISTINCTCOUNT ( EMP_TABLE[EMP_NO] ),
FILTER (
EMP_TABLE,
EMP_TABLE[EMP_RESIGN_DATE] >= EMP_TABLE[vCalDate10]
&& 'EMP_TABLE'[EMP_RESIGN_DATE] <= EMP_TABLE[vToday]
&& EMP_TABLE[EMP_STATUS] = "Working"
)
)

yingyinr_0-1616735436430.png

Best Regards

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

View solution in original post

3 REPLIES 3
v-yiruan-msft
Community Support
Community Support

Hi @saivina2920 ,

As checked your sample pbix file, there are some syntax error in measure [10to20Days] and [LessThan10Days]. Please update them with the below formulas and check whether it can get the correct result:

Note: The part in red font is newly added.

10to20Days =
CALCULATE (
    DISTINCTCOUNT ( EMP_TABLE[EMP_NO] ),
    FILTER (
        EMP_TABLE,
        EMP_TABLE[EMP_RESIGN_DATE] >= EMP_TABLE[vCalDate20]
            && EMP_TABLE[EMP_RESIGN_DATE] <= EMP_TABLE[vCalDate10]
            && EMP_TABLE[EMP_STATUS] = "Working"
    )
)
LessThan10Days =
CALCULATE (
DISTINCTCOUNT ( EMP_TABLE[EMP_NO] ),
FILTER (
EMP_TABLE,
EMP_TABLE[EMP_RESIGN_DATE] >= EMP_TABLE[vCalDate10]
&& 'EMP_TABLE'[EMP_RESIGN_DATE] <= EMP_TABLE[vToday]
&& EMP_TABLE[EMP_STATUS] = "Working"
)
)

yingyinr_0-1616735436430.png

Best Regards

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

Thanks for your reply.

Is it possible to upload the attachment in the post iteself.

because, i don't find any attachment link in the tool bar. that's why i given one drive link.

 

same related post in another thread. can you pls. check with that and reply when you are free.

 

https://community.powerbi.com/t5/Desktop/How-to-count-user-input-along-with-blank-field-od-date-colu... 

 

Hi @saivina2920 ,

You can get the updated file from this link.

Best Regards

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.