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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi , am new to power bi. can anyone help with this?
I need to find a difference between two date columns in fact table based on a flag in the fact table and one column in dimension table. This needs to be a measure.
thanks
Solved! Go to Solution.
@KV2022 , If both dates are in Fact, use related(Dim[Date]) if date is in dimension
Calculate(Sumx(Table, Datediff([Date1], [Date2], day) , filter(Table,Table[Col] = "ABC"), Filter(Dim, Dim[Col] ="ABC") )
You can use Averagex in place of sumx
Hi, @KV2022 ;
You could try to create this measure.
diff =
SUM ( 'fact'[flag] ) - SUM ( 'dimension'[column] )
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@KV2022 , If both dates are in Fact, use related(Dim[Date]) if date is in dimension
Calculate(Sumx(Table, Datediff([Date1], [Date2], day) , filter(Table,Table[Col] = "ABC"), Filter(Dim, Dim[Col] ="ABC") )
You can use Averagex in place of sumx
thanks.
But the dates are in fact table and so is the flag. Something like this
fact(actual end date)- fact(actual start date) on fact(flag) = value and dim(column) = value.
it needs to be a measure
@KV2022 , If values are coming from the slicer, you do not need even add filter code
Also, I suggested a measure only
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
thanks.I will try that
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 69 | |
| 46 | |
| 44 | |
| 28 | |
| 19 |
| User | Count |
|---|---|
| 199 | |
| 129 | |
| 102 | |
| 69 | |
| 55 |